Hey all,
I'm parsing this xml and can't get one attribute to work as a TextFormat.
I have an app that saves XML of objects on the screen, each object has a 
TextFormat attached to it so I save the XML
node with attributes for x, y, text  and Textformat. Below is what is returned 
to me when I load a previously saved XML.

<TemplateXML>
  <TextLayer xpos="83" ypos="39" label="Wowie" format="[object TextFormat]"/>
  <TextLayer xpos="16" ypos="150" label="italic text" format="[object 
TextFormat]"/>
  <TextLayer xpos="88" ypos="250" label="My New Album Label" format="[object 
TextFormat]"/>
  <TextLayer xpos="250" ypos="148" label="Side A" format="[object TextFormat]"/>
</TemplateXML>

You can see the format attribute is saved as a TextFormat object but when I 
parse it I get errors saying that it is an XMLList.

Here is the method to parse the XML:

var savedXML:XMLList = custXML.TemplateXML;

     for each(var lab:XML in savedXML.TextLayer){
                var labelText:String = String(l...@label);
                var x_pos:Number = l...@xpos;
                var y_pos:Number = l...@ypos;
                var savedFMT:TextFormat = l...@format as TextFormat;
                trace("New Label:"+labelText+"\nx pos:"+x_pos+"\ny 
pos:"+y_pos+"\nformat?"+savedFMT.font);//this throws errors
                
                recreateLayer(labelText,x_pos,y_pos,fmt);//this creates a new 
MovieClip with a textField in it and positions it on the stage.
        }


Any tips would be helpful.

Thanks,

-Gerry_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to