Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
chris.ncic

add textfield with flextransformmanager [SOLVED]

Recommended Posts

real quick question. how would you go about adding a textfield to be managed by the flexTransformManager sometime after the transform manager is instantiated?

ex. flexTransformManager.addItem(someTextField);

 

i get errors in this case because the textfield isn't an uicomponent.

 

edit: i should also say that the parent of the textfield is currently a canvas, however i'm testing with uicomponent as the parent to help ease the problem.

 

thanks for your help.

Link to comment
Share on other sites

update: i've been testing with using a uicomponent as the parent of all the images and textfields to be managed instead of a canvas. it seems to solve some problems, however for some reason flextransformmanager doesn't seem to respond to the textfield as a managed object. it works fine for the the images.

 

if i do something like:

tempTransformItem = _flexTransformManager.addItem(tempTextField);

_flexTransformManager.selectItem(tempTextField, true);

 

the textfield will be selected, but as soon as i deselect the textfield i can't get the transform manager to manage it normally.

 

my main goal is to manage images and textfields with a single flextransformmanager, and they are currently all being added to a single uicomponent (verses a single canvas).

Link to comment
Share on other sites

i found my problem. i had a bug where my textfield was being immediately deselected because i had deselectAll() being called in a certain circumstance. so the transform manager was handling the textfield fine, it's just that the textfield would immediately get deselected. one thing i do want to forewarn others about is that in flex you may not want to use any container that requires you to use rawChildren.addChild, because the flextransformmanager is calling targetObject.parent.addChild and will throw an error.

Link to comment
Share on other sites

sorry for all the posts, i hope this is the last. i think i've got a new problem. it seems like all the transform events are firing for a textfield except 2 SELECT_MOUSE_DOWN, SELECT_MOUSE_UP.

 

update: i see the logic behind this now, ignore that post. :)

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.

×