This content has been marked as final. Show 4 replies
Wow, sorry for dup threads, please respond to this one and discard the other.
var bla = new Bla();
hmmmm.... that is interesting. Where is the LoadVars()? If that is the part you are having trouble with, that would be the part to show us. My guess is that you expect flash to wait on the LoadVars() line until the content is loaded and then proceed. That is not how Flash works.
It sends the load request and then keeps going merrily along. You need to wait until the data is fully loaded and then you can do something with it.
Read the help files. Look in the ActionScript Dictionary or ActionScript 2.0 Language reference under the LoadVars class. You should see the onLoad() event and a code sample of how it works.
Check the help files and post back with your code and we should be able to get this worked out for you.
Ya, but how do I know that it's done loading. You see the line:
The first time I run the flash this is undefined, then when I generate a key push event which I programed, the data flushes and there it is. What would be the proper way to put my data in my method so I have it in the begining ?
addNew() basically pushes the data on to an array and redrawMenu() takes that array and draws what I want. Even though you can see I am redrawing my menu after I get my data it is not there.
BTW I've prettly much memorized the LoadVars doc page.. lol Thanx for helping.
The code is getting messed up with everything in italic. Makes me think there is a squarebracket-i someplace that I can't see. But regardless...
I had missed that you were using the onLoad. So what is this parentobj? Just an object or is it an array? And the solution is probably in the "basically pushes the data on to an array."
Over all it looks like it should work, but without knowing what addNew() and reloadMenu() do exactly it is hard to track down. Just work it through one step at a time to find which step is "loosing" the data.