FORUMS: list search recent posts

Main menu return

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
shawn eyre
Main menu return
on Feb 3, 2009 at 3:53:05 pm

I have a linked video that plays from a main menu. When the get started button is clicked, bam the video plays in the same window as my main menu. Perfect. But what i need it to do is when its finished playing, return to the main menu automatically. I'm ok with a button the when clicked takes you back to the menu. Help??



Return to posts index

Graham Quince
Re: Main menu return
on Feb 5, 2009 at 11:09:20 am

You need a listener object for your video:


var listener = new Object();
listener.complete = function(objetEvt) {
_root.gotoAndStop("mainmenu");
};
yourVideo.addEventListener("complete",listener);

Graham

http://www.YouTube.com/ShiveringCactus - Free FX for amateur films


Return to posts index

shawn eyre
Re: Main menu return
on Feb 5, 2009 at 5:53:59 pm

Awesome. Thank you so much for the code. Now i'll show my ignorance. Where does it go in the code sequence? Here is all my code including what you gave me.

var video:Video = new Video(720, 486);
addChild(video);

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);

function onStatusEvent(stat:Object):void
{
trace(stat.info.code);
}

var meta:Object = new Object();
meta.onMetaData = function(meta:Object)
{
trace(meta.duration);
}

ns.client = meta;

video.attachNetStream(ns);

ns.play("BEESeq.flv");

plyButton.addEventListener(MouseEvent.CLICK, playHandler);
ns.pause();

function playHandler(e:MouseEvent):void {
ns.resume();
}

ar listener = new Object();
listener.complete = function(objetEvt) {
_root.gotoAndStop("mainmenu");
};
yourVideo.addEventListener("complete",listener);


I get that I have to make the main menu an instance, so I made it a movie clip. Yes, no? Thoughts.



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]