A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Stoping a simple movieclip

  1. #1
    Junior Member
    Join Date
    Jan 2003
    Posts
    13

    Stoping a simple movieclip

    Hey everyone,

    My problem might sound real simple (and probably is), but I can't manage to stop a movie clip. Here's the structure of my .fla :

    On the main canvass, I have a button. Let's call that button myButton. If I double-click myButton, I can access the objects that are under myButton. Among these objects, there is a movieClip (myClip). This clip starts right from the beginning.

    I simply want myClip to pause whenever my mouse is over myButton. I tried to go on myClip (the one on the 'OVER' event of myButton) and add a clipEvent(load) and (enterframe) to tell him to stop, and it didn't work. I also tried to go on the rollOver event of myButton-> _root.myButton.myClip.stop(); , and it didn't work. What can I do?

    Cheers everyone!

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You cant tell a movieclip inside a button to do anything. Have the movieclip on the canvas instead, give it an instance name ( myMC ) and target it from the button.

    on(rollOver){
    myMC.stop();
    }
    on(rollOut){
    myMC.play();
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    It sounds like your movie clip is inside the button, in which case its best to move it from there to place it on the same timeline as the button together in the same frame.

    give the clip an instance name, myClip and the button the instance name myButton (obviously you can be more creative with the names if you want )

    now add a frame action in the frame that contains both symbols,

    code:

    myButton.onRollOver = function() {
    myClip.stop();
    };
    myButton.onRollOut = function() {
    myClip.play();
    };



    hope this helps

  4. #4
    Junior Member
    Join Date
    Jan 2003
    Posts
    13
    Thanks fellas!! Really helped!

    Still think that it's a bit odd that you can't control a movie that is within a button...

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