Jump to content
Search Community

setting childIndex of VideoLoader

friendlygiraffe test
Moderator Tag

Recommended Posts

I have a VideoLoader called 'video', when it completes I'd like to change it's depth

 

public function completeLoadHandler(event:LoaderEvent):void
	{
		video.playVideo();
		setChildIndex( event.target.content, 0 );
	}

 

...but it outputs the error:

TypeError: Error #1034: Type Coercion failed: cannot convert []@60cc0bc9 to flash.display.DisplayObject.

What am I doing wrong here ?

Link to comment
Share on other sites

try something like this, it will actually wait for your video to finish and should move it after.

 

public function completeLoadHandler(event:LoaderEvent):void

{

video.playVideo();

video.addEventListener(VideoLoader.VIDEO_COMPLETE, VideoFinished, false,0, true);

}

function VideoFinished():void

{

setChildIndex( video, 0 );

}

Link to comment
Share on other sites

try something like this, it will actually wait for your video to finish and should move it after.

 

public function completeLoadHandler(event:LoaderEvent):void

{

video.playVideo();

video.addEventListener(VideoLoader.VIDEO_COMPLETE, VideoFinished, false,0, true);

}

function VideoFinished():void

{

setChildIndex( video, 0 );

}

thanks, but is it possible to move the video before it starts playing. I want to have text overlaying the video as it's playing

 

Thanks

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...