Copy link to clipboard
Copied
If I have XML like this:
|
How can I have the SWF reads the time and play at 35 seconds and stops at 111 seconds?
Thanks,
Copy link to clipboard
Copied
use actionscript.
var s:Sound = YourSound();
var sc:SoundChannel = s.play(35000);
var t:Timer=new Timer(111,1);
t.addEventListener(TimerEvent.TIMER,sF);
t.start();
function sF(e:TimerEvent):void{
sc.stop();
}
Copy link to clipboard
Copied
That would be the answer for MP3. The question was about MP4.
Copy link to clipboard
Copied
oops.
Copy link to clipboard
Copied
are you using an flvplayback component to play your video? the netstream class? something else?
Copy link to clipboard
Copied
Thank you, Kglad and Colin. I've not decided as I'm converting from AS2. It's custom UI so I think netstream is more likely.
Thanks,
Copy link to clipboard
Copied
you play the steam and then immediately pause it. repeatedly check the bytesLoaded (though bufferLength should be better, but i've had problems with it in the past) and when enough data is loaded use the seek method to start play at 35 seconds.
you can use a timer like the above to stop play (or use a a loop and repeatedly check the netstream's time property).
Find more inspiration, events, and resources on the new Adobe Community
Explore Now