This content has been marked as final. Show 4 replies
You need to replace the dots inside of the array. You could do this:
I think. Your naming convention, the underscores, and the caps make it really hard to read and follow what is trying to go on there.
Thank you for such a quick reply. I still don't have this quite working, but I tried to clean this up to clarify what I'm asking (I didn't realize until I started stringing all of those movie clips together how illegible all those all caps and underscores were, sorry). Here is the cleaned up version:
What I am trying to convert to use array access operators (where parent.child takes the place of those illegible letters from before)
_level600.parent.child.num_" + _level0.x + "_hit._alpha
What I'm trying to get it to concatenate to (the x variable = 1 in this case)
Thank you for the help!
The array notation says look inside this object for something with whatever is between the square braces. So if on the same timeline as the code there is a clip called myClip and it has a child called myChild you could get its _alpha like this:
and so on…
In the above case nothing is dynamic so there is no need to use the concatenation +, but if you just think about each step in the path as its own array of objects it gets easier. Those are just strings above because we are looking for the name of something. If they weren't strings, Flash would think they are variables and try and find an object in that object with a name that matched the value of the variable. So if you need dynamic names, you you just start adding things together
I'm a bit confused by parent without the _ and then _alpha with it. Is this AS2 or 3?
Thank you for the help! I'm finishing converting all of my evals over to the [ ] operators and hoping that this will speed up the movie. In regards to your comment about the "parent", i only meant that loosely to describe the chain of movieclips being referenced (I had a confusing string of all caps before, so I replaced that to make it easier to read) It wasn't meant to be the official _parent
Thank you so much for your help, I think you saved me at least another couple hours lost in stare...