I just delved into Actionscript 3 and Flash and was wondering how you would create a Toolbar for my app’s UI without coding in the Timeline since this is bad Object Oriented practice. For example, my toolbar has a Pointer Tool and a Draw tool. When I click the Pointer Tool button in the toolbar, I want it to be depressed. I understand you’ll probably have to create different keyframes for each “state of the button” but how would I control the state in code without using goToFrame or coding in the Timeline?
Share
I see 2 potential classes here:
With your individual classes extending Tool
Your Toolbar class would create and manage the Tool objects. Tool would contain event listeners for clicks which is where you can change the state to depressed and so on. I’d probably have a property like
_currentToolin Toolbar and call a setter for this property when you click a tool. Kinda like..