Jump to content


Export/Apply Item XML Examples

Recommended Posts

Hey there!


I've been going through the documentation and can't find any examples of exportItemXML and applyItemXML in action.


Here's what I'm trying to do: I've got one SWF where users will load an image (using ImageLoader). Once it's loaded, I create a transform manager and apply it to the image. Users can transform the image. When they're done, I export the XML as a node inside a larger XML structure, and then save it all to a database. This all appears to be working without a problem.


Now imagine that the user wants to transform the image again. So they load up the page, we retrieve the item XML from the database, and then apply it to the transform manager. This is where the problem happens: I get the error "TypeError: Error #1009: Cannot access a property or method of a null object reference."


This is the XML that we've got on load:


Here's the code I'm using to apply the XML:

_imgManager.applyItemXML(myXML.imageXML.item as XML);


And the error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.greensock.transform::TransformManager/applyItemXML()
at com.thecosmonaut.view::Builder/onContentInit()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.greensock.loading.core::LoaderCore/_completeHandler()


Any idea what I'm doing wrong?


Thanks in advance,



Link to comment
Share on other sites

Tinkered around and found the problem. The XML was not properly formatted and was therefore coming through as null. This code ended up working:


var thisImageXML:XML = new XML(myXML.imageXML.item.toXMLString());


Thanks anyway!

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.