Actionscript newbie: simple stop issue

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default Actionscript newbie: simple stop issue

    Hello everyone.

    I'm trying to get a nested movie to stop playing when a 'stop' button is clicked. This movie is nested within two other movies, and I have the current actions assigned to the 'stop' movie clip (as opposed to the frame):

    on (release) {
    stop();
    }

    There is likely something embarrassingly obvious I am overlooking. Ideally, I'd like it to just pause and then continue on with a separate 'play' button, but for now I'll settle with just being able to stop the darn thing.

    Thanks for any help.

    -screen





    Screenweasel webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. Simple issue. Help, please.
      All my prints have a strong magenta cast. This appears on the preview as well as the final print, so it's not a printer issue. No doubt I have some...
    2. actionscript newbie trouble
      hi there, i'm trying to trigger a colour change in an movie clip as i drag it over another on, sounds simple but its driving me mad, any help would...
    3. actionscript newbie
      I am trying to create a very simple interface. I have a button and grey square filled with text off the screen. What I want to happen is this:...
    4. Simple Actionscript Help Needed! GotoandPlay
      Hello- I have a scene that stops on frame 20 (actionscript "stop();"). In that scene are 4 movie clips that make up a directional compass. Each...
    5. Hide button in actionscript. (newbie)
      Hi, I have a button in my movie that i'd like to make disappear when a value reaches a certain limit. The script for the button is: on...
  3. #2

    Default Re: Actionscript newbie: simple stop issue

    you need to reference the path/instance name of your movieclip.


    kglad webforumsuser@macromedia.com Guest

  4. #3

    Default Re: Actionscript newbie: simple stop issue

    Every time you use the ActionScript code

    on (release) {
    stop();
    }

    in a button by using the stop() alone you are telling the movie that contains the button to stop, but if you have movie clips the won't stop 'cause they animate independently. So to achieve this you have to give the movie clips waht is called an instance name. Here is an example:

    If you have a movie clip of a car that moves in the root timeline, and inside this movieclip you have a movie clip of a wheel that rotates then you can use the following technique:

    Select the car movieclip and in the property inspector there is a textBox with the words <InstanceName>. Type a name for the car in this textBox, for example "car_mc".

    The edit the car movieclip and select the wheel and in the InstanceName textbox type "wheel_mc".
    Now the two elements that you need to control have instance names.

    Then in the button that must be in the _root timeline write this code:

    on (release) {
    car_mc.wheel_mc.stop();
    }

    This means that the wheel_mc movieclip that is inside the car_mc movieclip has to stop.



    juankpro webforumsuser@macromedia.com Guest

  5. #4

    Default Re: Actionscript newbie: simple stop issue

    Well, I've tried both methods, with absolute and relative pathways, and for some reason it still isn't working. My code looks like this:

    on (release) {
    mainstage.todaymovie.stop();
    }

    I've tried this in every timeline: root, mainstage, and todaymovie, and nothing works. Thanks for trying to help, though. Maybe I'll stumble across the solution.

    -screen


    Screenweasel webforumsuser@macromedia.com Guest

  6. #5

    Default Re: Actionscript newbie: simple stop issue

    Got it to work. No idea how. I didn't do anything different I hadn't tried before. Used this:

    on (release) {
    _parent.stop();
    }

    in the movie one down from the one I wanted to stop.

    Thanks for everyone's help. =-)

    -screen


    Screenweasel webforumsuser@macromedia.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139