Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / May 2006



Tip: Looking for answers? Try searching our database.

Storing value from XML into a variable

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sun4none - 17 May 2006 09:03 GMT
There is a combo-box by the name "cbJobs" and it gets its value from the XML
file named "data.xml".. I want to store the value transferred from this XML
file into a variable.. so basically someone told me to use the code

on (change) {
 _root.subject = this.getValue();
}

the only problem with this code is that it gets activated only after I
"change" the value in combobox by pulling it down.. I want to use this value
obtained from _root.subject as a subject in the script

getURL("mailto:abc@abc.com?subject="+_root.subject);

so any suggestions as to what shall appear in place of "on (change)" ?? Thank
you!
Motion Maker - 23 May 2006 00:37 GMT
You either store a String or an object as part of the data in the combobox
item.
my_cb.addItem({data:"Subject is blah", label:"First Item"});

Then you can use in the change event listener.
var cbListener:Object = new Object();
cbListener.change = function(evt_obj:Object) {
var item_obj:Object = my_cb.selectedItem;
trace(item_obj.data);
};
my_cb.addEventListener("change", cbListener);
http://livedocs.macromedia.com/flash/8/main/00003195.html

Signature

Lon Hosford
www.lonhosford.com
May many happy bits flow your way!

There is a combo-box by the name "cbJobs" and it gets its value from the XML
file named "data.xml".. I want to store the value transferred from this XML
file into a variable.. so basically someone told me to use the code

on (change) {
 _root.subject = this.getValue();
}

the only problem with this code is that it gets activated only after I
"change" the value in combobox by pulling it down.. I want to use this value
obtained from _root.subject as a subject in the script

getURL("mailto:abc@abc.com?subject="+_root.subject);

so any suggestions as to what shall appear in place of "on (change)" ??
Thank
you!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.