A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: AS3 Movieclip and Main timeline trouble

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    2

    AS3 Movieclip and Main timeline trouble

    Hi all.. im new here.
    im having some AS3 trouble and was hoping you guys may know the answer.
    im doing a sort of a website thingi on flash for one of my college projects.

    i have the main menu buttons in the main timeline and the contents of every page inside movieclips. there is one movieclip which triggers a sound clip. what i want to do is to make that sound stop when someone navigates away from the page (that is for the sound to stop when a button in the main timeline is clicked)

    anyone knows how to do it?

  2. #2
    Member
    Join Date
    Aug 2010
    Posts
    33
    You could put this on each of your buttons on your stage.

    myButton.addEventListener(MouseEvent.CLICK, stopSound);
    function stopSound(e:Event):void{
    nameOfTheSound.stop();
    }

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    2
    Yeah thats the only solution i have too.. but the problem is the buttons the user have to click to navigate away from the page are outside the movieclip which declared the variable for the soundclip.

    I made a smaller file. It'll help you understand the problem.
    http://www.sendspace.com/file/4b99pu

    Click on the button inside the moviecip first and then quickly click on the button to page 2. you'll see the sound wont stop.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center