-
go from one flv to another automatically???
I have 3 videos at this site... the first one plays automatically.. is it possible to get the second one to play (which I guess would mean jumping to that frame) when the first flv is done playing? any help would be appreciated. Thanks.
http://www.continentalrto.com/buywithoutdebt/
-
Listen to the video player for a COMPLETE event - when you get that you can just spoof a click on the next button:
PHP Code:
var activeButton = button1;
vidPlayer.addEventListener(Event.COMPLETE, function(e:Event):void{
switch(activeButton){
case button1:
activeButton = button2;
button2.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
break;
case button2:
activeButton = button3;
button3.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
break;
case button3:
default:
activeButton = button1;
button1.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
break;
}
});
-
thanks a lot for the help! Any chance of a quick explanation of that code? why 3 buttons? I'm kind of new to as3... thanks!!!!!!
-
Just looking at your three buttons on that link...if you've got those in an array you could just move through that or whatever .... basically you just need some way to trigger the next video and if you already have buttons set up you can just piggyback off the same code those are using.
-
so, in this :
var activeButton = button1;
button1 should be changed to the name of my button?
-
This might help you help me...
This is what I have on frame 1
Code:
stop();
vid2.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler99);
function mouseDownHandler99(event:MouseEvent):void {
gotoAndStop(5);
}
vid3.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler98);
function mouseDownHandler98(event:MouseEvent):void {
gotoAndStop(10);
}
This is what I have on frame 5
Code:
stop();
vid1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler100);
function mouseDownHandler100(event:MouseEvent):void {
gotoAndStop(1);
}
vid3.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler98);
function mouseDownHandler101(event:MouseEvent):void {
gotoAndStop(10);
}
This is what I have on frame 10
Code:
stop();
vid1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler100);
function mouseDownHandler102(event:MouseEvent):void {
gotoAndStop(1);
}
vid2.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler99);
function mouseDownHandler103(event:MouseEvent):void {
gotoAndStop(5);
}
-
any chance anyone can help me with this... probably easy for the right person.. Thanks!!!
-
ok... please please help if you can!!!!! this is what I'm finding online.. but it's not quite working..
Code:
function complete(eventObject:Object):Void {
gotoAndStop(5);
}
my_FLVMOVIE.addEventListener("complete", this);
stop();
any ideas.....?????
-
figured this out on my own if anyone cares....
named my movie player "vid"
put this code on the same key frame as the video...
Code:
vid.addEventListener(Event.COMPLETE, completeHandler);
function completeHandler(event:Event){
gotoAndStop(5);
}
Then my next video (which is on frame 5) I named "vid02" and put this code...
Code:
vid02.addEventListener(Event.COMPLETE, completeHandler2);
function completeHandler2(event:Event){
gotoAndStop(10);
}
then my last video (on frame 10) I named "vid03" and made it jump back to the first video with this code:
Code:
vid03.addEventListener(Event.COMPLETE, completeHandler3);
function completeHandler3(event:Event){
gotoAndStop(1);
}
Probably basic for most people.. but I'm glad I figured it out. If you're new like me... just remember your completeHandler has to have a different name each time... like completeHandler1, completeHandler2, etc..... anyway.. thanks to anyone who was going to help me.
-
I thought I figured this out... it pretty much works... but if you click thru the 3 movie buttons fast, or chaotically.... they go nuts.. and never get back on track. They just keep jumping around... you can see here: http://www.continentalrto.com/buywithoutdebt/ any ideas how to prevent this???? Please help!!!! This is extremely time sensitive, and I'm losing my mind!!! Thanks!
-
When you click quickly you're opening a bunch of videos at once and then navigating away - but those net streams are still coming in and when they complete it fires your onComplete for each of those...Try removing the eventHandlers and closing the video...something like this:
PHP Code:
vid.closeVideoPlayer(0);
vid.removeEventListener(Event.COMPLETE, completeHandler);
-
Thanks for your reply. I've tried that in a couple spots, but it's giving me errors.. can you tell me where I should put it? this is the code on frame 5 for example:
Code:
vid02.addEventListener(Event.COMPLETE, completeHandler2);
function completeHandler2(event:Event){
gotoAndStop(10);
}
should it go above the top line? or above the gotoAndStop line? Also, I would put this:
Code:
vid.closeVideoPlayer(0);
vid.removeEventListener(Event.COMPLETE, completeHandler);
in this frame correct? I don't want to put this:
Code:
vid02.closeVideoPlayer(0);
vid02.removeEventListener(Event.COMPLETE, completeHandler);
because I can't delete what's playing... the point is to close or remove the vid that the timeline just left... correct? or am I missing the point? Thanks again!
-
You want to fire that code when you click off to a new frame so it should probably be in your buttons' handler - and you'll want to target the video player that's currently on stage at that moment.
-
[PHP]I was thinking the same thing after I asked that question... but I'm getting this error...
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at home_fla::MainTimeline/mouseDownHandler99()
this is my button code on frame one.. (button names are vid1, vid2, vid3 respectively..
PHP Code:
stop();
SoundMixer.stopAll();
vid2.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler99);
function mouseDownHandler99(event:MouseEvent):void {
gotoAndStop(5);
vid.closeVideoPlayer(0);
vid.removeEventListener(Event.COMPLETE, completeHandler);
}
vid3.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler98);
function mouseDownHandler98(event:MouseEvent):void {
gotoAndStop(10);
vid.closeVideoPlayer(0);
vid.removeEventListener(Event.COMPLETE, completeHandler);
}
any ideas?
-
so in your mouseDownHandler99 function (99 - ?!) you need to make sure that's getting called when vid is on stage - if not you can use an if-then to trap it:
PHP Code:
if(vid){
vid.removeEventHandler...
}
-
this code is in frame 1... and vid is in frame 1. it's on the stage when I press button vid2 or button vid3. Shouldn't have to trap it... not that I would know how to do that anyway.. but if vid is playing.. while I'm pushing the button... it's on the stage, correct?
-
Yeah - but since your code is an event handler you have to remember that it's getting handled the frame after the event - so if your playhead is moving in that time, things can get offset...
-
If you're still having trouble can you post all the code in the frame or a copy of your fla?
-
ok... so I'm learning a lot.. but I still don't really know what I'm doing... is this even close? I don't know what to put for "else"... ?
PHP Code:
if(vid){ vid.closeVideoPlayer(0); vid.removeEventListener(Event.COMPLETE, completeHandler); } else { how do I say do nothing... }
-
can you download it from here? www.kalcotter.com/continental/home.fla
it's too big to upload.... I'm sure it's not the most "efficient" file... thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|