Richard Ryu

How to get movie clip from transformItem

Recommended Posts

I read transformManager document a few times, and I don't understand either one.

 

I want to get movie clip from transformItem.

I understand how to get movie clip under the event method like below :

 

function onSelectClip(event:TransformEvent):void {

    var mc:MovieClip = event.items[0].targetObject as MovieClip;
}

 

But I want to get movie clip from transformManager(var manager:TransformManager) directly.

 

So I try,

var mc:MovieClip = manager.getItem();

 

Could you give me an advice?

 

Share this post


Link to post
Share on other sites

A single TransformManager can manage many items, though. You can get an array of all of the targetObjects or items like:

//array of all the target objects (DisplayObjects like MovieClips)
manager.targetObjects;

//array of all of the TransformItems (each has a targetObject):
manager.items

So if you're only managing one thing, you could do: 

manager.targetObjects[0]

Does that help? 

  • Like 1

Share this post


Link to post
Share on other sites

A single TransformManager can manage many items, though. You can get an array of all of the targetObjects or items like:

//array of all the target objects (DisplayObjects like MovieClips)
manager.targetObjects;

//array of all of the TransformItems (each has a targetObject):
manager.items

So if you're only managing one thing, you could do: 

manager.targetObjects[0]

Does that help? 

 

Oh my godness, I understand perfectly.

Thank you very much.

 

From now, I can make it sense :)

Share this post


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

  • Recently Browsing   0 members

    No registered users viewing this page.