Instances
Accessing instances by names
Let's try to call instances by their names and observe results.
- Create three buttons on the stage from the same symbol. It will be good if you create a distinguished Over state to imitate rollover – we need to see if the button is functional. You can change button appearance inside instance restrictions (size, advanced color..) .
- Give first button an instance name, for example "button1"
- In the event handler of the second button enter the following code
on(release) { button1.useHandCursor = false; } - For the second button enter similar code but install useHandCursor property of button1 as true;
- Test the movie. You will see that first button is a real button – on rollover it changes.
However by using other buttons you may disable a
hand cursor. Click a minus button
and touch bigger button - it doesn't display
had cursor any more. However other instances do.
Referring by instance name doesn't influence other instances of the same symbol.