Jump to content
Search Community

After applyFullXML the width of every item is 1 but height is correct

dandoen test
Moderator Tag

Recommended Posts

Hi,

 

I'm trying to use the applyFullXML functionality and am doing everything according to the documentation but somehow I can't manage to make it work properly. So this is how my XML looks like:

 

<transformManager>
<settings allowDelete="1" allowMultiSelect="1" autoDeselect="1" constrainScale="0" lockScale="1" scaleFromCenter="0" lockRotation="0" lockPosition="0" arrowKeysMove="0" forceSelectionToFront="1" lineColor="3381759" handleColor="16777215" handleSize="8" paddingForRotation="12" hideCenterHandle="0"/>
<items>
<item name="achilles.png" level="2" a="1" b="0" c="0" d="1" tx="420" ty="339" xOffset="0" yOffset="0" rawWidth="345" rawHeight="272" scaleMode="scaleNormal" hasSelectableText="0" minScaleX="Infinity" minScaleY="-Infinity" maxScaleY="Infinity"/>
<item name="logo.swf" level="2" a="1" b="0" c="0" d="1" tx="321" ty="347" xOffset="0" yOffset="0" rawWidth="402" rawHeight="94" scaleMode="scaleNormal" hasSelectableText="0" minScaleX="Infinity" minScaleY="-Infinity" maxScaleY="Infinity"/>
</items>
</transformManager>

 

I am loading the assets using your LoaderMax class as following:

 for each (var item:XML in XMLItems.items.*) {
  Main.queue.append(
   new SWFLoader("media/"+item.@name, {
	name:item.@name,
	container:area
   })
  );  
 }

 

After the entire queue is loaded, I am doing this:

manager.applyFullXML(XMLItems, area);

 

But somehow, the width of the TransformItem and the DisplayObject are both returning 1, even though the rawWidth is loaded correctly from the XML. Just before doing applyFullXML the objects' sizes are correct, so my implementation of LoaderMax can't be the problem. What makes it strange is that the height seems to be exactly as defined in the XML, while the width is 1...

 

Any idea what I'm doing wrong?

 

Thanks!

Link to comment
Share on other sites

After getting slightly upset over this, I found out I made a stupid mistake when generating the XML from my mySQL database. If you look at the preview of my XML, you'll see that I don't have maxScaleX attribute and the minScaleX attribute contains the value of maxScaleX. After fixing this, I'd say: case closed. Thanks anyway. Keep up the great work!

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.
×
×
  • Create New...