AS3: gotoAndPlay when an FLV file is finished playing
THE PROBLEM:
So, I recently created a showcase reel that involves several flvs with transitions between. For various reasons, I had to make this a timeline based animation. I was running into a problem with latency because of download times and the flvplayback component. The flvs would play and the transitions between the flvs would occur really late.
THE SOLUTION:
Add an event listener to the flv instance and listen for COMPLETE.
Select File > Import to Stage > Your FLV file name
(There are lots of options when importing FLV files. Select what is appropriate for your project.)
Step 2: Give your flvs instance names ( for the first FLV, I chose the very creative instance name flv1)
Step 3: Create a new layer, name it labels
Step 4: Set a keyframe on for the first frame of each flv file and give a label name on the properties tab
Step 5: Create an actions layer, create a keyframe for the first frame of each flv file (just like you did for the label names)
Step 6: Import the VideoEvent.
On the first frame of the Actions layer place this code:
Step 7: Add this code to each key frame, changing the instance name, function name and gotoAndPlay() label name.
function videoOver1(e:VideoEvent)
{
gotoAndPlay(”part2″);
}

VIEW THE TUTORIAL : On FLV Complete gotoAndPlay()

READ MORE ABOUT the FLVPlayBack component
This entry was posted
on Tuesday, December 8th, 2009 at 1:10 pm and is filed under flash, tutorial.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Leave a Reply
- « Older Entries
- Newer Entries »
