PDA

View Full Version : [AS3] Context Sensitive Mouse



Dazzer
December 4th, 2006, 12:57 PM
This is related to a project I'm working.

Its a design application. And so, there'll be several tools to use.

Which would be a better way to proceed to acheive context-sensitive functions?


1) global boolean values
- have boolean values that dictate whether the state is active, and check for that state whenever a mouseevent occurs?
2) single "state" value
- 1 value that mouseevent checks for to determine the state the mouse is in?
3) changing listeners to specific objects that will accept that event?

Thanks in advanced for any replies.

Dazzer
December 4th, 2006, 09:41 PM
-bump-sorry!

mishonis
September 12th, 2008, 03:39 PM
2)try single state value. The simplest way is a State class with static string constants, e.g. State.SOME_STATE, State._ANOTHER_STATE, etc. Then you can have static methods State.setState() and State.getState().