315 posts
  • Bought between 100 and 499 items
  • Has been a member for 7-8 years
  • United States
timmylogue says

Whats the best way to change a string via click of a button?

var xmlFile:String = "CHANGE_ME.xml" ;

I want to change CHANGE _ME.xml to CHANGE _ME2.xml with a button click.

Anyway possible? I want to have multiple buttons. Is there a switch statement I could use?

Thanks Timothy

315 posts
  • Bought between 100 and 499 items
  • Has been a member for 7-8 years
  • United States
timmylogue says

Anyone? Please.

var xmlFile:String = "main.xml";
var urlReq:URLRequest = new URLRequest(xmlFile+"?time=" + new Date().getTime());

Like i said…I want to have a switch case which will allow me to change the string “main.xml” to “main2.xml” all the way up to “main12.xml” with click buttons.

4136 posts
  • Bought between 1 and 9 items
  • Brazil
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • Sold between 5 000 and 10 000 dollars
tsafi says

Adding a String var for xml name don’t do nothing, you need to load that xml first .

Don’t ask me for the code there are many ways doing it ,best way in my view if you have a template is to load all XML in one chunk via array loader, this way you don’t call a new loader every time you swap XML ,…note if you have an external swf that carry XML that have it’s on parameter you will not include those XML on your main array XML loader, unless you know your way around working with external class with singles most likely.

315 posts
  • Bought between 100 and 499 items
  • Has been a member for 7-8 years
  • United States
timmylogue says

Gotcha. That’s all I need to know. I understand.

Thanks!

by
by
by
by
by
by