actionscript 3 - AS3: How can I stop and loop FLV playback? -


i'm trying make credits page video playing in background , when menu button on screen clicked taken main menu , video stop. when debugging app though, following code cause cycle through 5 scenes @ lightspeed, not sure causes this. i'll show code likes , code doesn't.

bugged code:

stop();  import fl.video.*; import flash.events.videoevent;  playback.source = "tonight's night.flv";  function flvdone(event:videoevent):void{     event.target.stop(); }  playback.addeventlistener(videoevent.complete, flvdone);  function flvdone(event:videoevent):void{     event.target.stop(); }  //menu button btnmenu.addeventlistener(mouseevent.mouse_up, menu5clicked);  function menu5clicked (e:mouseevent){     gotoandstop(1)     flvdone() } 

working code no stop feature:

stop();  import fl.video.*; import flash.events.videoevent;  playback.source = "tonight's night.flv";  //menu button btnmenu.addeventlistener(mouseevent.mouse_up, menu5clicked);  function menu5clicked (e:mouseevent){     gotoandstop(1) } 

here's output

warning: duplicate label, scene=scene 1, layer=bg, frame=2, label=credits warning: duplicate label, scene=scene 1, layer=bg, frame=3, label=credits warning: duplicate label, scene=scene 1, layer=bg, frame=4, label=credits warning: duplicate label, scene=scene 1, layer=bg, frame=5, label=credits

fonts should embedded text may edited @ runtime, other text "use device fonts" setting. use text > font embedding command embed fonts.

this appears in both versions of code when debugged


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -