Jump to content
Search Community

how to load video behind rest of content

rojharris test
Moderator Tag

Recommended Posts

Hi,

 

I am using VideoLoader to play a video on the stage. I need to then play movie clips that are description boxes of parts in the movie, over the top of the movie. However when I test the swf the movie is loading over the top of my boxes. I am using tweenlite to fade in the boxes when the movie hits cuepoints. How can I get the movie to play behind my movieclips? Here is a lump of my code so far:

 

Thanks,

Roger

 

------------------------

var genieVid:VideoLoader = new VideoLoader("assets/GenieMovie.f4v",{container:this,width:850,height:480,scaleMode:"proportionalInside",bgColor:0x000000,autoPlay:true});

genieVid.load();

 

genieVid.addEventListener(VideoLoader.VIDEO_CUE_POINT, cueHere);

 

function cueHere(event:LoaderEvent):void

{

if (event.data.name == "Sec1Pause1")

{

genieVid.pauseVideo();

 

TweenLite.to(p1all_mc.p1b1_mc, 1, {alpha:1, delay:1});

TweenLite.to(p1all_mc.p1b2_mc, 1, {alpha:1, delay:2});

TweenLite.to(p1all_mc.p1b3_mc, 1, {alpha:1, delay:3});

 

TweenLite.to(p1all_mc, 1,{alpha:0, delay:10});

 

genieVid.playVideo();

 

}

/*else if(event.data.name == "Sec1Pause2")

 

genieVid.pauseVideo();

 

TweenLite.to(p1all_mc.p2b1_mc, 1, {delay:1,alpha:1});

TweenLite.to(p1all_mc.p2b2_mc, 1, {delay:2,alpha:1});

TweenLite.to(p1all_mc.p2b3_mc, 1, {delay:3,alpha:1});

 

genieVid.playVideo();*/

 

}

-------------------------

Link to comment
Share on other sites

Whenever you define a "container" for a loader, it immediately adds it to that container with an addChild(). So if you already have your boxes (or whatever) on the stage when you create your loader, addChild() will put it on top of those. The solution is pretty simple, though - use addChildAt() to define a specific index. For example, to put it underneath everything else, do this:

 

var genieVid:VideoLoader = new VideoLoader("assets/GenieMovie.f4v",{width:850, height:480, scaleMode:"proportionalInside", bgColor:0x000000, autoPlay:true});
this.addChildAt(genieVid.content, 0);

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...