music_lp90 Posted September 9, 2008 Share Posted September 9, 2008 EDIT: I didn't figure out the associative array, but I found another way of doing it Link to comment Share on other sites More sharing options...
justsomeguy Posted September 9, 2008 Share Posted September 9, 2008 First, I think I've mentioned this before but with Flash you don't need to start variables with a $ symbol. I think you're going to end up confusing yourself when you have two different variables like $instanceName and instanceName. Variable names are supposed to be descriptive and the $ doesn't add a lot to distinguish one variable from the other.You have a problem here:$position[a] = saveData;In that context the variable a is the object that you just dragged, it's a movie clip object. You can't use a movie clip object as an index to an array. Array indices need to be either numbers or strings. It would probably be best when you create the movie clip to also store the instance name as a property of it.instanceName.myName = $instanceName; (see how it's confusing to have 2 variables with the same name?)Later on when you're saving the position of the moved object you can use that property to get the index that you should use for the arrays. Link to comment Share on other sites More sharing options...
music_lp90 Posted September 9, 2008 Author Share Posted September 9, 2008 Thanks justsomeguy. Yes, I see what you mean about the variables being confusing, so I'll work on getting those changed. I like to use the $ sign just so at a glance I can know I'm dealing with a variable, but I have not been consistent with that. So, I will work on that and try to get the movieclip name instead of using the actual object as the key. For some reason I thought using "a" would use it's name. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.