Todd
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by Todd
-
-
I can add the items to the transformManager using the .addItem(object).
var oNode:ImageRender = new ImageRender(x, y, w, h, imgUrl); var uiComp:UIComponent = new UIComponent(); uiComp.addChild(oNode); oContainer.addChild(uiComp);
After the user interacts w/ the display & moved the node around, then I read the object(s) back out of the container to write their
new position to my data stream.
// - Loop through the oContainer controls var oaNodes:Array = oContainer.getChildren(); if (oaNodes.length > 0) { // - Loop & process nodes // ***Note***; The pageContainer has UIComponents, which inturn has a single clsItemRender or clsTextRender var oUIComp:UIComponent = null; var oImageRender:ImageRender = null; for (var nIndex:int = 0; nIndex < oaNodes.length; nIndex++) { // - Are we an actual 'UIComponent' ? oUIComp = oaNodes[nIndex] as UIComponent; oImageRender = oUIComp.getChildAt(0) as ImageRender; if (oImageRender != null) { // var myRect2:Rectangle = pageContainer.getBounds(oImageRender); // var myRect2:Rectangle = oUIComp.getBounds(oImageRender); trace(" - oUIComp.transform.matrix.tx = " + oUIComp.transform.matrix.tx.toString()); trace(" - oUIComp.transform.matrix.ty = " + oUIComp.transform.matrix.ty.toString()); trace(" - oImageRender.transform.matrix.tx = " + oImageRender.transform.matrix.tx.toString()); trace(" - oImageRender.transform.matrix.ty = " + oImageRender.transform.matrix.ty.toString()); } }
Even when the image node is moved within the transformManager, I always get the inital x/y. The oImageRender.transform.matrix.tx / ty always give me 0/0.
Any ideas?? I get values from the oUIComp.tx/ty, but they are not right either, (I could always convert them relative to the oContaine??)
Thanks in advance.
-
I know that I am just missing something simple here. I can read all of my displayObjects so that I can save them to my data stream. After I move an item, I always get the original position information that was used to place it in the transformManager. So what am I missing??
Reading x/y after moving object
in TransformManager (Flash)
Posted
I was wondering about that. Since the UIComponent is what is getting added to the transformManager, & the imageRender object is a child of the UICompnent.
I will give a try to getting the UIComponent information.