View Full Version : Need to go to next frame after flv plays
cody1234
11-24-08, 10:36 AM
I have a flash video playing in swf file, however, after the video is finished playing, i would like the swf to go to the next frame. How would i go about doing this? Right now it just plays whatever the end of the video shows, and wont go any further.
Or, just have it it go back to frame 1 after palying. Any feedback would be greatly appreciated.
thanks.
I assume the video is in the timeline not being loaded externally ? if so
gotoAndPlay(1);
or
gotoAndStop(1);
would work, create a key frame at the end of the video(last frame) and add this code in the key frame.
What version of action script are you using 2 or 3?
if it is being loaded externally you need to use cue points in the video and code it to replay.
cody1234
12-2-08, 03:56 PM
What version of action script are you using 2 or 3?
if it is being loaded externally you need to use cue points in the video and code it to replay.
I am using action script 2 and the video is loading externally off the server. never used ure points before...
OK
If you are using the video component in flash, you need to recreate your flv.
in flash, go to file/Import/Import Video and import your original video (.mov, .avi) or whatever
type of file that the movie is.
Select the video file in the Import video box click next.
click "Progressive download from a web server", click next.
Below your movie there is a button called Cue Points click on it.
Scub the movie to the point that you need the Cue point to be
in the left there is a + button click on it, this will create a cue point
name it, I just name my cue point by numbers like "cue1" "cue2"
this is an Event so be sure the the Type is Event and click next
add what ever skin you are using and click next
then click finish now you have a cue point in your movie so we need to call it in actionscript
and when the movie is in you may need to relocate it on stage
put this code in the actionscript frame 1 or where ever you have your movie,
gotoAndStop(2); will move your timelime to frame 2 when the cue point is called
if you did not name your cue point cue1 rename the code
if you did not name you component vid rename code
//code
stop();
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
// Put any code you like here
trace("Cue point name: " + eventObject.info.name);
trace("Cue point type: " + eventObject.info.type);
if(eventObject.info.name=="cue1"){
gotoAndStop(2);
}
}
vid.addEventListener("cuePoint", listenerObject);
output should be--
Cue point name: cue1
Cue point type: event
cody1234
12-3-08, 11:16 AM
Guy:
I can get this to work with a .mov file, but my client provided me with a .flv video. It will not let me change the cue points from actionscript to event as needed. Also, when i import the flv file, it doesnt give me the options to add cue points from the beginning like the .mov?? Any ideas?
OK this will do the same thing but you need to know the time in the movie
that you need the cue point to be called--
I assume that the movie is in the flash app, if not import the movie (flv).
Click on the movie component on stage.
Go to Parameters, if the parameters box is not open go to the window button on top
of flash, click Window, Properties, Parameters
In parameters on the left it should say "Component" if not your not in parameters.
Scroll to cuePoints click where it says None, click on the magnifying class this will
open the "Flash Video Cue Points" box.
Click on the + button, name your cue point, and give it the time that you need this cue point to be called
like this "00:01:06.100" this time is 66.1 seconds or 1 min 6 seconds 100 milliseconds
Output should be
Cue point name: cue1
Cue point type: actionscript
Use the same code
Event and Nav cue points are not editable so we will need to use ActionScript cue points
cody1234
12-3-08, 02:37 PM
That worked! thank you. helped me out tons. Have a good one.
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.