PDA

View Full Version : [AS3] FLV playback wont stop after the page has changed


cduncs
07-02-2009, 09:19 PM
(Flash ActionScript 3)

Hi there,

I'm very new to Flash and i am trying to close a FLVPlayback component from a button in a parenting movieClip

I have been successful in closing the video using a button from the same movieClip that the component resides.

I did this using the following AS:

.................................................. .................................................. ...........


test_btn.addEventListener(MouseEvent.CLICK, test_btnClickHandler);
function test_btnClickHandler(event:MouseEvent):void {
showreel_flv.getVideoPlayer(showreel_flv.activeVid eoPlayerIndex).close();
MovieClip(parent.parent.parent).allPages.gotoAndPl ay("cv");
trace("test_btn Button CLicked");
}


.................................................. .................................................. .........


But i am wanting to use a button that is at least a x3 parent of the component.

This is the hierarchy of my site (all movieClip's):

entireSite>allPages>showreel_page>showreel_video> (the component).

the button i want to use is in:

entireSite>allPages>footer_btns> (the buttons)


if someone could show me how to direct my command to the component, then quite frankly, you would be my hero!


Thank you so much

I'd be very grateful if anyone could even point me in the right direction, and i will help others as much as i can.

DukeW
07-13-2009, 10:02 AM
If I understand your problem is the fact that when you navigate to another page FLV playback doesn't stop. You can solve this by using Event.REMOVED_FROM_STAGE. This way there,s no need to manually tell the layer to stop when ever you navigate to any other page than the one it resides in. Here's a small example of how the event mentioned above should be used:
flVPlaybackInstance.addEventListener(Event.REMOVED _FROM_STAGE, stopPlay);
function stopPlay(e:Event)
{
flVPlaybackInstance.stop();
}