View Full Version : Jump to new Frame after FLV is completely playing
jbruso
07-06-2007, 07:23 PM
I'm trying to jump to a new frame after this FLV is completely played. But, it's not working.
/**
Requires:
- FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
//gotoAndPlay(3);
// or
_root.gotoAndPlay("menu");
};
my_FLVPlybk.addEventListener("complete", listenerObject);
my_FLVPlybk.autoRewind = false;
my_FLVPlybk.contentPath = "<A href="http://dev.sheridan.edu/Home_page_int/IntroMovie/intro_sheridan.flv";[/CODE">http://dev.sheridan.edu/Home_page_int/IntroMovie/intro_sheridan.flv";
Does it matter that the FLV is in a SWF and the swf is loaded remotely. Isn't the root SWF that is doing all the loading considered the _root?
EDIT:
I found that _lockroot was on.. I took it off.. which enables the jump to the _root frame "menu", but the file isn't playing all the way though... it looks like it's immediately jumping right to "menu" instead of playing first.
box86rowh
07-06-2007, 07:33 PM
create a movie clip to keep track of the movie
_root.createEmptyMovieClip("watcher",_root.getNextHighestDepth());
Then set its on enter frame to do something when the video stops
_root.watcher.onEnterFrame = function(){
if(thePlayer.stopped == true){
goto the next frame...
}
}
jbruso
07-06-2007, 07:39 PM
Box,
Are you saying to do that method instead of the code I'm working with? Sorry, if I don't follow completely... this is kinda new to me.
box86rowh
07-06-2007, 07:44 PM
it will replace this code:
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
//gotoAndPlay(3);
// or
_root.gotoAndPlay("menu");
};
my_FLVPlybk.addEventListener("complete", listenerObject);
It will basically just watch the video object and when it stops, it kicks it over to your next frame
jbruso
07-06-2007, 07:54 PM
hmm, I'm not doing something right. It's just going back to the begining of the FLV.
If you could look at what I have, I'd be greatful.
http://dev.sheridan.edu/Test/jump/intro_movie.fla
There are 2 frames. The movie clip holding the FLV is on frame 2. if you double click into it you'll see the FLV and the Action script on top.
My AS is
import mx.video.*;
_root.createEmptyMovieClip("watcher",_root.getNextHighestDepth());
_root.watcher.onEnterFrame = function(){
if(thePlayer.stopped == true){
_root.gotoAndPlay(5)
}
}
my_FLVPlybk.contentPath = "http://dev.sheridan.edu/Home_page_int/IntroMovie/intro_sheridan.flv";
atomic
07-06-2007, 08:00 PM
Can you save in Flash 8 format and re-attach?
jbruso
07-06-2007, 08:01 PM
sorry about that. its in FL 8 now
atomic
07-06-2007, 08:14 PM
Use only this...
/**
Requires:
- FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
my_FLVPlybk.contentPath = "http://dev.sheridan.edu/Home_page_int/IntroMovie/intro_sheridan.flv";
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
_parent.gotoAndStop(5);
};
my_FLVPlybk.addEventListener("complete", listenerObject);
jbruso
07-06-2007, 08:39 PM
Hi Atomic,
Thanks for the code. It works fine within its own swf. However, when I try to load it inside of another swf, things break down.
I have a main.swf with an empty movie clip that is loading movies into itself on Frame 10.
The actions for that frame are:
//stop the playhead
//---------------------------------------------
stop();
mc_hold1.loadMovie("intro_sheridan.swf");
mc_hold1._lockroot = true;
That loads the movie we've been working on in this thread.
When I test the main movie, instead of playing all of "intro_sheridan.swf", it just jumps immediately back to _root.menu
jbruso
07-06-2007, 11:38 PM
Does anyone know if using an empty movie clip as a holder with _rootlock on will cause child swfs to be unable to call the _root timeline?
I have
_root timeline--Holder.swf---External intro.swf----External intro.fla
I'm trying to send the user from intro.swf to the _root timeline, but it's not working.
I've tried every variation of this I can think of????
_parent._parent.gotoAndPlay("menu");
_root.gotoAndPlay("menu");
this._root.gotoAndPlay("menu");
Instead of _parent or _root... can I just call the main timeline swf somehow??
atomic
07-07-2007, 12:26 AM
You should provide that main movie's .fla, so that I can test it...
But (I'm fishing...) have you tried _level0 to target the main timeline?
jbruso
07-07-2007, 03:37 AM
Thanks Atomic, fishing sounds like fun :) Actually, a friend here helped me find the problem. It was a silly codeing issue with my child swf. I was calling _root in a place where I should have been calling _parent. It's working now.
Thanks for everyone's help.
:) yay.
atomic
07-07-2007, 04:05 AM
;)
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.