PDA

View Full Version : move a MC by it's array ID??


kit kat
02-01-2009, 01:26 PM
Newbie question...

For some reason, I can't manage to move a MC when I specify it's array ID...


maze.onEnterFrame = function() {
if (Key.isDown(Key.LEFT) && (player._x <= marginA)){
this._x += walk_speed;
elev[0]._x += walk_speed;
setProperty(elev[1],_visible,0);
}
}


It works fine if I specify the instance (elevA._x += walk_speed;), and I can change things like the visibility calling the array position... I just can't make it move...

What's going on? :confused:
Thanks in advance!

Shiki
02-01-2009, 07:14 PM
Is "maze" the container for elev[0]? Maybe you're using the wrong depth?
(I'm just asking some preliminary questions here ^_^x )

kit kat
02-02-2009, 05:42 AM
Thank you!

They are all on the same layer, thus, I think that if it was the wrong depth the "setProperty(elev[1],_visible,0); " part shoudn't work either either, because it calls it the same..., but it does :eek:

I've tried several comands and the only thing that doesn't seem to work is ._x += speed when applied to the array...

I'm completely puzzled.



Thanks again for replying!