Hi guys,
I'm using basic AS2 for loading up a video file and playing it. While playing it, i needed to pause it as say, 5 seconds and then wait for me to push a button. Upon pushing the button it should resume. Please look at this and let me know where i'm going wrong? The video loads, and plays, and pauses at 5 seconds as meant to. It also shows the button which is, until that point hidden. But the button doesn't un-pause when i click? The funny thing is, the button does pause and un-pause if you use it anytime before the loop has implemented the stop.
Here's the code to load the video:
And here's the code on the button:Code:// load video var nc:NetConnection = new NetConnection(); nc.connect(null); myNetStream = new NetStream(nc); videoPlayer1.attachVideo(myNetStream); myNetStream.play("_assets/16_airplane.flv"); // show timer function checkTime() { var ns_seconds:Number = myNetStream.time(); trace(ns_seconds) } // monitor the time and stop when meant to setInterval(checkTime,10); function checkTime():Void{ if(Math.floor(myNetStream.time) == 5){ btn_sometimes._alpha = 20; myNetStream.pause(); } }
Any ideas?Code:on (release) { myNetStream.play(); }