all groups > flash actionscript > november 2006 >
You're in the

flash actionscript

group:

Unique XML Help


Unique XML Help Ricky Bobby
11/30/2006 9:37:13 PM
flash actionscript:
I found a tutorial on XML and flash. However it only deals with dropping a
bunch on nodes in a combo box or list. I need help figureing out how to do the
following:

Lets say that I have an XML that looks like this,

<table>
<item id="4" email="email@blank.com" />
<item id="5" email="email2@blank.com" />
<item id="6" email="email3@blank.com" />
</table>

Now, what I want to be able to do is put a dynamic text field on the stage and
say, give me the email address for the id=4. Then in a totally different
dynamic text box, give me the email for id=5, and so on. These dynamix text
fields will all me in the same frame, so I am wantign to use actionscript on
the frame, but need the script that can put a certain attribute in an instance
of a text box according to an id that I specify in the code. Can anybody help
on this?

-Yours truly Ricky Bobby
Re: Unique XML Help Flashpuke23423
11/30/2006 10:58:22 PM
First off, Flash sucks hot flaming donkey dikk.

I'm trying to do something similar, and it won't work. The XML support is
long overdue to be upgraded. First off, you can't load XML syncrhonously.
And, because of such when you try loading an XML file in a class (for a
component) you can't reference anythign else in the class.

THE XML SUPPORT AND FLASH IN GENERAL IS SHIIT!!!!!!!!!!!!
Re: Unique XML Help Flashpuke23423
11/30/2006 10:58:49 PM
First off, Flash sucks hot flaming donkey dikk.

I'm trying to do something similar, and it won't work. The XML support is
long overdue to be upgraded. First off, you can't load XML syncrhonously.
And, because of such when you try loading an XML file in a class (for a
component) you can't reference anythign else in the class.

THE XML SUPPORT AND FLASH IN GENERAL IS SHIIT!!!!!!!!!!!!
Re: Unique XML Help Flashpuke23423
11/30/2006 10:58:54 PM
First off, Flash sucks hot flaming donkey dikk.

I'm trying to do something similar, and it won't work. The XML support is
long overdue to be upgraded. First off, you can't load XML syncrhonously.
And, because of such when you try loading an XML file in a class (for a
component) you can't reference anythign else in the class.

THE XML SUPPORT AND FLASH IN GENERAL IS SHIIT!!!!!!!!!!!!
Re: Unique XML Help Mister Peanut
11/30/2006 11:11:04 PM
Flashpuke, do you live in a trailer park?

Re: Unique XML Help Mister Peanut
11/30/2006 11:16:28 PM
Though you lack education, I can see you still have much creativity!

Good for you!

Re: Unique XML Help Flashpuke23423
11/30/2006 11:36:10 PM
Re: Unique XML Help Raymond Basque
12/1/2006 12:00:00 AM
import mx.xpath.XPathAPI;

var itemId:Number = 4;
var path = "*/item[@id='" + itemId + "']";
var tableNode:XMLNode = myXMLDoc.firstChild;
var itemNode:XMLNode = XPathAPI.selectSingleNode(tableNode, path);

trace(itemNode)
trace(itemNode.attributes["email"]);

Re: Unique XML Help Ricky Bobby
12/6/2006 8:32:34 PM
Wow, thanks raymond. this looks confusting, but thanks for helping me out, I
will use this code as a starting point. Any chance you could comment on this
[quoted text, click to view]

var path = "*/item[@id='" + itemId + "']";
Re: Unique XML Help Ricky Bobby
12/6/2006 10:04:07 PM
Can someone tell me if I am on the right track with this. Let's say that my
dynamic text field has an instance name of email. and my xml looks like the
following:
<table>
<item id="4" email="email@blank.com" />
<item id="5" email="email2@blank.com" />
<item id="6" email="email3@blank.com" />
</table>

how about this for part of the actionacript

var my_key = item.attributes.id;
for (my_key = 4){
email.text = item.attributes.email; // setting the text field to the
email for id=4
}
AddThis Social Bookmark Button