Hi everyone,
I try to make a clip that contains a shape and a button. Whenever the button is pressed I want the shape to move one frame to the right. I used “actionscript” to create that clip and this is how I did it:
In layer 1 which I named “circle” I created a circle and made it a symbol named “circle”.
At frame 10 I added a keyframe and made that tween a motion tween. In frame 1 I marked the circle and named the instance: “circle”.
I added a layer above “circle”, named it “button”, and created a square out of which I made a symbol named “Button”. That layer too had 10 frames of tween type: “none”. I marked the symbol in frame 1 and named the instance: "Button.
I adde another layer, on top of all the layers and called it: “Actions”. I marked
frame 1, opened “Actions” panel and assigned the code:
button.onPress = function()
{
circle.gotoAndStop(_currentframe+1);
};
I ran the clip and on the monitor a circle and a square showed up. When I laid the mouse on the “Square” shape, it showed an hand and a finger pointing at the square. When I pressed the mouse, nothing happened.
I wanted the circle to move one frame to the right as a response to a mouse click. Why didn’t it do it ?
Can anyone show me how to do it?
Thanks.