321 posts
  • Has been part of the Envato Community for over 7 years
  • Has collected 100+ items on Envato Market
  • Located in 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

321 posts
  • Has been part of the Envato Community for over 7 years
  • Has collected 100+ items on Envato Market
  • Located in 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.

4140 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Located in Brazil
+3 more
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.

321 posts
  • Has been part of the Envato Community for over 7 years
  • Has collected 100+ items on Envato Market
  • Located in United States
timmylogue says

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

Thanks!

Helpful Information

  • 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.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by