Okie, nOOb, here ya go:
I was flabbergasted at what I saw so I decided to REALLY lend a learning hand here. Hey...I was a nOOb once too...
Take a look at the file and, well, READ CODE and COMMENTS.
One function to set the position. To hide is basically to simply take a random # so that's what the hideball function does. Picks a random # and passes it to our set position function! Guess what! The names of the boxes? Yup. Just use #'s! Simple, right?
And for them there boxes, why drag 20 clips from the library when ya can easily make a grid with code? And name 'em in the process as well as give them a function for clicking on them? Dynamic is FUN!
Sounds like a lot but it's not really. Read. Learn. Have fun.
Timelines. All the references are really for the _root. But I never really say '_root', do I?
ActionScript Code:
setPos=function(name){
this.mov_ball._x=this[name]._x;
this.mov_ball._y=this[name]._y;
this.mov_ball.str_name=name;
};
Nope. I am using 'this' to reference 'this' timeline. It just so happens that the timeline we are on is in fact the _root! One reference in there is:
ActionScript Code:
this._parent.mov_to_target;
See if you can figure out exactly what I'm talking about there. (Hint: where is this line of code? So then what is 'this' (in this case) a reference to?)
Good luck and code on!