puthisorn
05-04-2004, 03:09 PM
I'm using MX 2004.
I'm making music player that take information from XML. I use the button component(Search) to submit the variable from combobox(genre) and myTunePHP. And, reload the XML data from new url, after I click button it's show the undefine variable from combobox. I don't know why, please help. I also don't know that I write the script correct to reload XML data into SongList. Help!
Download MyTunes.zip (http://putputty.com/Flash/MyTunes.zip)
Frame1 script
var myTunePHP = 'http://malevich.scam.ecu.edu.au/myTunes/mytunes.php';
myXML = new XML();
myXML.onLoad = MyTunesXML;
myXML.ignoreWhite = true;
myXML.load(myTunePHP);
ComboBox(Genre)
on (change) {
_parent.SearchType = _root.Genre.selectedItem.data;
_parent.SearchString = _root.Genre.selectedItem.label;
trace(_parent.SearchString);
}
Button(search)
on(click) {
var cmdLabel = '?cmd=' + _parent.SearchType;
var cmdValue = '&val=' + _parent.Searchstring;
trace(_root.myTunePHP + cmdLabel + cmdValue);
myXML.onLoad = MyTunesXML;
myXML.ignoreWhite = true;
myXML.load(_root.myTunePHP + cmdLabel + cmdValue);
}
I'm making music player that take information from XML. I use the button component(Search) to submit the variable from combobox(genre) and myTunePHP. And, reload the XML data from new url, after I click button it's show the undefine variable from combobox. I don't know why, please help. I also don't know that I write the script correct to reload XML data into SongList. Help!
Download MyTunes.zip (http://putputty.com/Flash/MyTunes.zip)
Frame1 script
var myTunePHP = 'http://malevich.scam.ecu.edu.au/myTunes/mytunes.php';
myXML = new XML();
myXML.onLoad = MyTunesXML;
myXML.ignoreWhite = true;
myXML.load(myTunePHP);
ComboBox(Genre)
on (change) {
_parent.SearchType = _root.Genre.selectedItem.data;
_parent.SearchString = _root.Genre.selectedItem.label;
trace(_parent.SearchString);
}
Button(search)
on(click) {
var cmdLabel = '?cmd=' + _parent.SearchType;
var cmdValue = '&val=' + _parent.Searchstring;
trace(_root.myTunePHP + cmdLabel + cmdValue);
myXML.onLoad = MyTunesXML;
myXML.ignoreWhite = true;
myXML.load(_root.myTunePHP + cmdLabel + cmdValue);
}