Raapwerk
Raapwerk

Reputation: 629

Making a symbol appear in Flash using AS 3

I would like to create a button in Flash CS6 that makes another symbol appear when clicked. Nothing fancy, just this. How would I do that? This is the code I've got so far:

stop();
button1.addEventListener(MouseEvent.MOUSE_UP revThing);
    function revThing(evt:MouseEvent):void{ 
    >what goes here..?<
} 

Upvotes: 0

Views: 54

Answers (1)

RST
RST

Reputation: 3925

One way of doing it is create a movieclip, leave the first frame empty, add a stop() action to it. Put your symbol on frame two, put a stop() action on it. Name the movieclip, for instance symbol_mc. Your command in the button should be

symbol_mc.gotoAndPlay(2)

Another way would be to hide the symbol off stage, and position it on stage on button click. Or have the symbol on stage already, but invisible, set visibility on button click.

Upvotes: 1

Related Questions