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?
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.
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.
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.