I actually considered writing that nearly exact same script. Unfortunately I realised that my movie clips were all differently named.
I'd have to make 'i' detect a variable in an array to be the name of the next clip to be tested and it would get too confusing and complicated lol
_____
Alex
As long as it's working now I'm happy as... a leprechaun? (i unno)
Finished script placed on the movie clip containing the clips that change in depth:
onClipEvent (enterFrame) {
movieClip1.swapDepths(movieClip1.Z);
movieClip2.swapDepths(movieClip2.Z)...
I tried that way and it seems to not work too well. The clips kept flashing. I suppose I could've make it set a variable right after the swap so that it doesn't swap back but I only thought of that after I tried this:
onClipEvent (enterFrame) {
movieClip1.swapDepths(movieClip1.Z)...
I want three movie clips with variable Z in them to change depths according to their Z value.
IOW: the one with the highest z would go in front, lowest would go behind them.
How do I do this?
Alex -
Kawamoto fan
Seems my action script skills are rusty... I used to know how to use arrays in functions
Can you remind me how to use an array in a hit test function?
(I wish I had a more up to date flash but I can't offord it lol)
I see what you mean and I will try it
I beleive that you've inspired me to use hitTest in a completely different way for some things i've been trying to do.
Do you think you could explain how I'd use the array though?
Diagram:
//
on stage:
BOX
MOVIE CLIP WITH CIRCLE IN IT
//
How would I write a script to see if the box and circle collide?
(If possible, using shape flag)
Oh one more thing
//
function detectCollision(what) {
for (var s in this) {
if (typeof (this[s]) == "movieclip") {
if (s != what) {
if (this[s]._x>what._x-50) {
if (this[s]._x<what._x+50) {
if (this[s]._y>what._y-50) {
if (this[s]._y<what._y+50) {
trace(s+" is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.