Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Load XML data to Flash with AS2

Guest
Sep 22, 2011 Sep 22, 2011

Hello to everybody!

Like many other members I'm new in flash and actionscript , so I need some help from the pros.

I have a XML file like this:

<root>   

  <Event TextOne="TextShow1" TextTwo="TextShow2"/> 

  <Event TextOne="TextShow3" TextTwo="TextShow4"/> 

  <Event TextOne="TextShow5" TextTwo="TextShow6"/>

</root>

All I want is to load the XML data in Flash in two dynamic text fields (TextOne_mc and TextTwo_mc) and make the TextOne_mc to show me first the "TextShow1" then the "TextShow3" etc and the TextTwo_mc to show me first "TextShow2" then "TextShow4" etc,but when I'm done with it,TextOne_mc shows me "TextShow5" and TextTwo_mc shows me "TextShow6" only,so I understand that I'm not done with it correctly and something missing. .

I hope you understood.Sorry if you don't understand my explanation.

Thank you!!

TOPICS
ActionScript
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 22, 2011 Sep 22, 2011

You need to append the values instead of Just assigning:

For example:

var str:String="Raja";

var str1:String="Rajan";

text1.text=str;

text1.text=str1;

After proceeding the above two statements it will display as Rajan. if you need both then it would be

text1.text=str;

text1.text+=str1;

The above is the concetatnation.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 23, 2011 Sep 23, 2011

Thank you for your reply!I found a fuction that helped me to complete my work.Thank you for your help anyway.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 23, 2011 Sep 23, 2011
LATEST

You're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines