Jump to content
GreenSock

mateo

Delete button. [SOLVED]

Moderator Tag

Recommended Posts

Hi, I love the transform manager.

 

Awesome.

 

I have been working on this question for a while but I can't seem to figure it out.

Is it possible to also include a "delete button" that works just like the "delete keystroke" does for the transform manager?

 

Thanks for any help you can provide that might steer me in the right direction. :)

Link to comment
Share on other sites

Sure, there's an undocumented deleteSelection() method you can call :)

 

Does that help?

Link to comment
Share on other sites

Would something like this work?

 

Delete_btn.onPress = function() {

deleteItem();

}

 

Thanks for your help. :P

Link to comment
Share on other sites

Ah, are you using the AS2 version? Sorry - I thought you were using AS3. There's no deleteSelection() method in the AS2 version. You could, however, do something like:

 

Delete_btn.onPress = function() {
   myManager.selectedItem.deleteItem();
}

Link to comment
Share on other sites

For some reason I can't get this to work for me,

 

Delete_btn.onPress = function() {

manager_obj.selectedItem.deleteItem();

}

 

ummmmmmmm

 

I feel that I am getting closer,

 

Thanks for your help,

I really appreciate it. :)

Link to comment
Share on other sites

It might just be a scope issue. Try this:

 

import mx.utils.Delegate;

Delete_btn.onPress = Delegate.create(this, onPressDelete);
function onPressDelete():Void {
   manager_obj.selectedItem.deleteItem();
}

Link to comment
Share on other sites

Gosh,

It feels like that should work.

I must be missing something.

 

Thanks very much for all your help. :)

Link to comment
Share on other sites

  • 4 weeks later...

In AS3, it's as simple as:

 

myManager.deleteSelection();

 

:)

Link to comment
Share on other sites

  • 1 year later...
In AS3, it's as simple as:

 

myManager.deleteSelection();

 

:)

 

but the move tool icon remain there.. ?

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×