LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 


  #1  
Old 06-10-2001, 07:46 PM
teewo teewo is offline
Registered User
 
Join Date: Jun 2001
Posts: 1
Rep Power: 0
teewo is on a distinguished road
dear flashers, i'm want to accessing a xml object's attributes in flash but the only way i know how is to use the name of the attributes for example:

pointerHead.childNodes[1].attributes.name;

is there any other way to access the attributes besides using the attribute name? maybe an array that will iterate through the attribute names?

thanks in advance
Reply With Quote
  #2  
Old 06-11-2001, 10:13 PM
Vagabond Vagabond is offline
MUG Member
 
Join Date: Feb 2001
Posts: 87
Rep Power: 13
Vagabond is on a distinguished road
u betcha ...

the attributes is a collection object, so you can do anything with it that you can a collection.


Code:
str = {{{ any xml snippit }}}; // xml lost in post
doc = new XML(str);
doc.firstChild.attributes.order = "first";
doc.firstChild.attributes.order2 = "second";
doc.firstChild.attributes.order3 = "third";

for (att in doc.firstChild.attributes) {
	trace(att + " = " + doc.firstChild.attributes[att]);
}
__________________
admin: sig removed broken link
Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
as 2 external text file into array accessing problems floody123 Actionscript 2.0 1 12-03-2008 01:22 PM
Accessing Buttons/MC via Actionscript MrG Flash 8 6 11-07-2007 12:13 PM
Image Attributes with XML Connector nisibee Actionscript 2.0 Components 0 07-24-2005 06:33 AM
xml - creating dynamic attributes bat7 Flash MX ActionScript 2 11-15-2004 03:44 PM
XML Node Attributes problem! Zev Halfon XML & Sockets 2 10-13-2000 01:30 PM




All times are GMT. The time now is 07:48 PM.