-
[RESOLVED] declaring sound variable from exported as3 name, but using int variable
Hey guys,
I have a simple question...
I want to create a sound variable depending on the numeric value of another int variable...
meaning: automatize the currentSnd variable depending of the soundValue
example:
Code:
var soundValue:int;
soundValue = 3;
var currentSnd:Sound = new this["snd" + soundValue] (); //<--- not working, but something like this
//instead of the working code:
// var currentSnd:Sound = new snd3 ();
(snd1, snd2, snd3, etc...are already exported to actionscript with those names...)
Thanks a lot in advance!
Cheers,
-
Got help from another forum, here's the solution:
Code:
var currentSnd:Sound = new public::["snd" + soundValue]
Thanks anyway!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|