PDA

View Full Version : moving with script problems...


Ben_jazz
11-10-2005, 07:47 AM
Hi,

I have a movie clip that i want to attach to the stage and then move...I can attach it but i cant get it to move....Here is the script i used. Any ideas? I have the code in a movie clip on the stage. I have also tried using......this._x += xmov but find that other things on the stage move along with the ball.

onClipEvent (load) {
timeBetweenBalls = 2000;
nextBall = getTimer() + timeBetweenBalls;
score = 0;
numBalls = 0;
lastBall = 0
xmov = 5;
}

onClipEvent (enterFrame) {
// see if it is time for the next ball
if (getTimer() >= nextBall) {

// shorter wait next time
timeBetweenBalls -= 10;

//attach ball and then move it
attachMovie("ball", "ball"+lastBall, lastBall);
_root["ball"+lastBall]._x += xmov;
}
}

bomoh
11-10-2005, 11:15 AM
where are you attaching that mc "ball" ???

try changing _root["ball"+lastBall]._x += xmov; to this["ball"+lastBall]._x += xmov;

attachMovie("ball", "ball"+lastBall, lastBall); -> attachMovie("ball", "ball"+lastBall, this.getNextHighestDepth());

Ben_jazz
11-10-2005, 11:35 AM
Hi,

I am attaching the movieclip from the library using the linkage method.

I will try your idea tonight when i get home.

Thanks for helping...

bomoh
11-10-2005, 11:38 AM
i ment... are you trying to attach it on _root or inside the movieclip where the functions are ... that's why you'r code didn't work... change your code with the code that i gave you and it will work