I’m programming a kind of “Lights Off” game in Flash Professional (not Flash/Flex Builder)
and it would be very nice if I could manage on/off state in a grphically designed Symbol like this:
square1.on();
/* calling this method produces the same as */
square1.on = true;
square1.gotoAndStop("onState");
/* obviously, the next method: */
square1.off();
/* will produce */
square1.on = false;
square1.gotoAndStop("offState");
Is this possible? How do I create the custom on property and custom methods on() and off()? If not possible, what else can I do?
Thank you.
Use a property like
stateand create two functions to change that state and navigate the playhead.Also, you should be extending MovieClip to create these custom properties… better practice.
[Tutorial] Export for ActionScript