e4x xml nodeName

  • Skin
  • Student
  • Student
  • User avatar
  • Posts: 76
  • Loc: United Kingdom

Post 3+ Months Ago

hI,

I am currently migrating to as3 with e4x xml.
I am trying to migrate a controller class I have in as2 that iterates through an xml tree and builds a controller object that controls apperance and content of a flash application.

In my as2 class i would use the "nodeName" to retrieve an elements name therefore the script was completely dynamic to any xml file and would build the contents of the controller object relative to nodeNames.

I am trying to decifer a way of doing this with e4x but am struggling to find the syntax. I have tried using a for each iteration using the new "elements () " function but e4x doesn't seem to recognise the nodeName function.

Can anyone advise on a method for this, I am sure with e4x's capabilities this must be possible.

Cheers

Skin
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

A start http://livedocs.macromedia.com/flex/2/l ... LNode.html

// Edit -- Looks like name().localname may be what you're looking for, see the examples at http://livedocs.macromedia.com/flex/2/l ... html#name()
NOTE: The anchor in that url needs the () that Ozzu is excluding from being clickable.
  • Skin
  • Student
  • Student
  • User avatar
  • Posts: 76
  • Loc: United Kingdom

Post 3+ Months Ago

Excellent,

I have itertaed through elements using for each(var element:XML in xml.elements())

and just element.name() worked! The localname is for use when using namespace and targets the local side of the whole name. This has been a great help.

Thanks a lot.

Skin

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.