-
Now listen heah!
another quick loadVars question -->
my problem is hopefully a simple one.
Loading vars from a txt file - works
parsing vars into a usable array - works
calling the vars from anywhere in the flash file - does not work
Code:
varReceiver = new LoadVars();
varReceiver.load("http://www.somedomain.com/mp3/songs.php");
varReceiver.onLoad = function() {
songs = this.fileList.split("|");
titles = this.titleList.split("|");
artists = this.artistList.split("|");
}
if i trace the vars inside the function, they output the correct values. i.e. trace(songs[0]); ... however if i call it anywhere outside the function it is undefined...
how do i get the values out of the class!?!?
-
AKA [ Paul Bainbridge]
Try this
code:
this._parent.songs = this.fileList.split("|");
this._parent.titles = this.titleList.split("|");
this._parent.artists = this.artistList.split("|");
Hope it helps
-
Now listen heah!
great idea, but no dice
I think there's something about classes that I'm just not getting. it seems like it should be simple enough. I usually use _root.varName and that works. I also tried _global.varName and it still didn't work!
-
Developing For Dunkets
If your trying to avoid using _root then try
var home:MovieClip = this
varReceiver = new LoadVars();
varReceiver.load("http://www.somedomain.com/mp3/songs.php");
varReceiver.onLoad = function() {
home.songs = this.fileList.split("|");
home.titles = this.titleList.split("|");
home.artists = this.artistList.split("|");
}
trace(home.songs[0]);
If the trace works the variables should be out. Hope that helps!?
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
|