Can't figure this one out...
...this works
...this doesn't
My only idea is that it doesn't like the "." in "myVars.Name" ???
How can I get around this?
...this works
Code:
on(release)
{
var TempMusicName1 = "slammal";
currentSong++;
VarVar = "TempMusicName";
VarVar += currentSong.toString();
PlayVar = this[VarVar];
trace(PlayVar); //result slammal
}
...this doesn't
PHP:
//PHP file "GetSongNames.php"
<?PHP echo 'Name0=slammal&Name1=whatever'; ?>
Code:
// actionscript 2
// frame action to load variables
myVars = new LoadVars();
myVars.load("GetSongNames.php");
// button action
on(release)
{
currentSong++;
VarVar = "myVars.Name";
VarVar += currentSong.toString();
PlayVar = this[VarVar];
trace(PlayVar); //result undefined????
}
My only idea is that it doesn't like the "." in "myVars.Name" ???
How can I get around this?
Last edited: