Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
KSumner

Better Selection Control

Recommended Posts

I am trying to manually handle certain selecting. I need to be able to run some logic before a selection is made to determine if an object should be selected or another action should take place.

 

For example, I have an Image that can be transformed. The Image has it's own Buttons that can handle mouse events. If a user clicks on one of these elements I do not want the element to be selected, but have the event fire from the Button. If the user clicks on the Image I would like it to be selected.

Link to post
Share on other sites

There are many ways you could handle this:

 

1) Listen for each TransformItem's SELECT event. Run your logic in that handler. Deselect it if necessary.

 

2) Add a MOUSE_UP listener to your DisplayObject(s) with a low priority (so that it gets called AFTER TransformManager's listeners). Run your logic in there. Again, toggle the selected property if you need to.

 

3) Listen for the TransformManager's SELECTION_CHANGE event. If the TransformManager's "selectedItems" array is populated, you know something was just selected, and you can run your logic.

 

Does that help?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×