I'm writing a MS Paint like simple program in Flash with pure ActionScript 3.0
- A toolbar that allows you to select what shape (star, heart…) you want to draw
- Another toolbar for color options, where each button is a color (red, green). there are 10 colors total.
- Then there's the canvas, its where the shapes will be drawn when clicking.
I have the following classes
class Main extends sprite
class ColorButton extends sprite
class ShapeButton extends sprite
class Star() extends sprite // star object to be added to Main (canvas)
class Heart() extends sprite // heart object to be added to Main (canvas)
Since I'm new to AS Im not sure how to / where to save the state (user selection). How can clicking a button change what a click on the canvas does? I think I need to use EventDispatcher? Could you guys point me to the right direction?