3 Replies Latest reply on Sep 7, 2006 6:31 AM by aniebel

    help - how to apply action script

      hi. i made a movie clip buttons. one of their layers is a hit surface (an invisible buttons).
      in the main scene (scene 1) i have created a layer of few pictures that i want to pass between them with the help of those buttons. i have created a labels on the time line of the scene. and each hit surface (of the movie clip buttons) was received the action : on (release) { gotoAndStop ("scene 1","pic3"); } (pic3 is the name of one of the labels on the time line of scene 1) and it doesn't work. i wonder if i should use different action..
      please help me.
        • 1. Re: help - how to apply action script
          aniebel Level 2
          Try to avoid placing any code directly on movieclips and buttons. Try to always keep it on your main timeline. This helps keep it tidy so that one doesn't have to go searching for code somewhere down the road. Also, try to avoid using the whole "scene" bit.

          You don't need to worry about putting the inv. button on your mc in order for it to act as a button if that's why you put it there. As soon as you tell a mc to react to a button event (onRollOver, onRelease, etc.) it will act as a button.

          Give this a shot...
          on frame 1 of your main timeline:
          myMC1_btn.onRelease = function(){

          Replace "myMC1_btn" with the name of your first mc button. Then copy and past that code, change the name of the mc for your second one and change the frame label to correspond.

          Let me know if this helps.
          • 2. Re: help - how to apply action script
            achwell Level 1
            thanks a lot. it helped me... but i have lost the inner activity in the mc button (its color change. shape tween when rollover and rollout) which was embeded to the invisible button. in addition, when i tried to apply this inner activity on the nc itself (with its name. like you said but in the movie clip timeline, it didn't work. i can put all these frames of inner activity on the main timeline for each button but i wanted to avoid it.. if you have a solution i will be grateful.

            • 3. Re: help - how to apply action script
              aniebel Level 2
              Can you post the actionscript that you had applied to the invisible button? It will help to understand what you are trying to do. If you are reusing this button for several items and want the same or similar actions to occur, then it's wise to include those actions in the movieclip itself or use a function with parameters that can change for each instance. Let's see what you have and we can try to come up with a good solution.