Skip to main content
Participant
January 10, 2009
Question

Swf keeps playing when I move webpage...

  • January 10, 2009
  • 1 reply
  • 226 views
New to this and using Flash CS4/AS3 to build simple website...and everything works fine apart from the swf movie keeps playing when I move to another page.

I am using MC buttons to go to labels on a timeline in a MC.
On the time line 'videos' I dragged on UIloader to play a swf of a video. My problem is that when I go to another page (along the timeline), 'home' or 'contact' etc, the swf is still playing from the 'Videos' section. You can't see it of course but can hear the sound. If I click back to 'Video' the swf starts to play again over the first play.
I have stop action on timeline above each different section, but this just stops all the pages from cycling.

Hope this makes sense...I'm just learning this stuff from tutorials etc
I guess I need to find some way to stop it playing when I go to the other pages, but I am stumped...

below is the code i'm using for the buttons.

function btn1Over(event:MouseEvent):void {
btn1.gotoAndPlay("over"); }

function btn1Out(event:MouseEvent):void {
btn1.gotoAndPlay("out"); }
function btn1Click(event:MouseEvent):void {
btn1.gotoAndPlay("click");
MovieClip(parent).allPages.gotoAndPlay("home");
}

btn1.addEventListener(MouseEvent.ROLL_OVER, btn1Over);
btn1.addEventListener(MouseEvent.ROLL_OUT, btn1Out);
btn1.addEventListener(MouseEvent.CLICK, btn1Click);
This topic has been closed for replies.

1 reply

clbeech
Inspiring
January 10, 2009
you will need to 'target' the loader instance within your click handler method, and tell it to 'stop()' also whenever you navigate to another frame.