Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
digger2k3

applyItemXML - nothing happening

Recommended Posts

Hi,

 

I'm trying to apply the exported values from exportItemXML() to my Objects:

 

	public function rebuildDocument () : void
	{
		var items : XMLList = new XMLList(mController.getOpenDocumentXMLFileContent());

		for (var i : int = 0; i < items.elements("element").length(); i++)
		{
			var classType : Class 			= getDefinitionByName("com.abc.airwiimotewhiteboard.view.modules." + items.elements("element")[i].elements("module")) as Class;
			var m : Module 					= Module(new classType());
			m.controller 					= mController;
			m.document 						= this;
			m.module 						= items.elements("element")[i].elements("module");
			m.name 							= items.elements("element")[i].elements("name");
			m.newBounds 					= new Rectangle(items.elements("element")[i].elements("x"), items.elements("element")[i].elements("y"), items.elements("element")[i].elements("width"), items.elements("element")[i].elements("height"));
			m.fillColor 					= items.elements("element")[i].elements("fillColor");
			m.fillTransparency				= items.elements("element")[i].elements("fillTransparency");
			m.strokeColor 					= items.elements("element")[i].elements("strokeColor");
			m.strokeThickness 				= items.elements("element")[i].elements("strokeThickness");
			m.strokeTransparency 			= items.elements("element")[i].elements("strokeTransparency");
			m.text 							= items.elements("element")[i].elements("text");
			m.textColor						= items.elements("element")[i].elements("textColor");
			m.mouseValues 					= String(items.elements("element")[i].elements("mouseValues")).split(";");
			m.mouseValueStrokeColor			= items.elements("element")[i].elements("mouseStrokeColor");
			m.mouseValueStrokeThickness 	= items.elements("element")[i].elements("mouseStrokeThickness");
			m.mouseValueStrokeTransparency 	= items.elements("element")[i].elements("mouseStrokeTransparency");
			m.tableCols 					= items.elements("element")[i].elements("tableCols");
			m.tableRows 					= items.elements("element")[i].elements("tableRows");
			m.diagramXSubDivs				= items.elements("element")[i].elements("diagramXSubDivs");
			m.diagramYSubDivs 				= items.elements("element")[i].elements("diagramYSubDivs");

			mBackgroundSprite.background.addChild(Module(m));
			m.rebuild();
			m.transManager.applyItemXML(new XML(items.elements("element")[i].elements("transformation")[0].toXMLString()) , mBackgroundSprite.background);
			mElements.push(m);

		}
	}

 

my xml-data looks like this:

 

<?xml version="1.0" encoding="UTF-8"?>



     MRectangle


     MRectangle107762724657


     340


     294


     322


     189


     1


     1


     0


     0


     1


     0


     1


     1


     ]]><br />    </text><br />    <textColor><br />      <![CDATA[0


     ]]><br />    </mouseValues><br />    <mouseStrokeColor><br />      <![CDATA[0


     0


     0


     1


     1


     1


     1


     1






 

My objects are just Sprites and "redbuild()" draw's the content. The Sprites are located at 0,0 after calling applyItemXML() and no transformation applyed :(

Link to comment
Share on other sites

sorry - my fault ... i've removed the tags "" and "" and now it's working perfect!

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.
×