okay i make my xml code got that
then i make a dynamic text field to load the info got that
but how do i get it to load text ‘A’ for click on button a
and text ‘B’ for button b?
This would depend on how your xml is structured. The most common way would be to create an array to hold the data parsed from your xml and then assign that info to the array using a for loop. I have included a sample below, but again this is based on how your xml is structured. For simplicity of the explanation I have left out the xml object setup and load as I assume you know how to load xml into flash. If you need more help after this, upload your files and I will set it up for you with comments.
sample xml document:
<buttons>
<button1 name=“Button1”>
<text>this is the text that you want to load on click<text>
<button1>
<button2 name=“Button2”>
<text>this is the text that you want to load on click<text>
<button2>
<buttons>
Sample actionscrip 2.0 code
//Create an array that will store the info parsed from the xml
buttonDataArray:Array = new Array();
//This for loop will go inside of your xml load function
var i:Number;
for(i=0;i<2; i++){
buttonDataArray* =myXml.firstChild.childNodes*.childNodes[0].firstChild.nodeValue;
}
//On release the function will set the text
myButtonA_btn.onRelease = function(){
myTextBoxA_txt.text = buttonDataArray[0];
}
myButtonB_btn.onRelease = function(){
myTextBoxB_txt.text = buttonDataArray[1];
}
Hope this helps
Sean