# Flash 4 To Flash 5 Nightmare!

I got some code i used for flash 4 which makes these balls in my background move around and when they collide they bounce off each other and the walls. But when i try to publish it in flash 5, it’s not compatible. Would anyone mind looking at the code and telling me if there’s anything I can do to make it compatible with flash 5???

Here it goes.
The first frame within my movieclip has the actions

tellTarget (“color”) {
gotoAndStop (getProperty("…/", _name));
}

I doubt this is what is causing the problem.

the 2nd frame within my movieclip has the actions

// ----------------------------------------------
// start move
// ----------------------------------------------
// ‘n’ is always ‘name’ of circle.
my_x = getProperty("", _x);
my_y = getProperty("", _y);
my_n = getProperty("", _name);
if (Number(ymov) == Number("")) {
// *********************************
// ----------------------------------------------
// first run through code,
// this will initialize circle
// ----------------------------------------------
// *********************************
// pick a distance:
ymov = Number(random(/:speed))+1;
xmov = Number(random(/:speed))+1;
//
// pick a direction:
ysign = random(2)-1;
if (Number(ysign) == 0) {
ysign = 1;
}
xsign = random(2)-1;
if (Number(xsign) == 0) {
xsign = 1;
}
// adjust x and y movement
xmov = xmovxsign;
ymov = ymov
ysign;
// ----------------------------------------------
}
// *********************************
// ----------------------------------------------
// check edges
// ----------------------------------------------
xmov = xmov*-1;
}
ymov = ymov*-1;
}
xmov = xmov*-1;
}
ymov = ymov*-1;
}
// ----------------------------------------------
// check for collision
// ----------------------------------------------
n = 1;
// start checking for collisions
while (Number(n)<=Number(/:total_circles)) {
// don’t check myself
if (n ne my_n) {
delta_x = (Number(my_x)+Number(xmov))-(n_x);
delta_y = (Number(my_y)+Number(ymov))-(n_y);
// ----------------------------------------------
// handle collisions
// ----------------------------------------------
// I collided with circle ‘n’.
// swap travel values with it.
tempx = xmov;
xmov = nx;
tempy = ymov;
ymov = ny;
} else {
}
}
n = Number(n)+1;
}
// ----------------------------------------------
// move me
// ----------------------------------------------
setProperty ("", _x, Number(my_x)+Number(xmov));
setProperty ("", _y, Number(my_y)+Number(ymov));
// ----------------------------------------------

i’m betting this is where there’s going to be some issues.

The last frame contains this :

gotoAndPlay (_currentframe-1);

Outside in the main timeline these are the actions

total_circles = 5;
movie_width = 750;
movie_height = 550;
speed = 11;

I’ll be really impressed if someone can tell me how to fix my problem You must be a ActionScript god! Thanks in advance
-Jon

ps: I can send you my .FLA if you think it’ll be easier.

I think this is a job for Suprabeener

I tried taking a look, but I have to admit that flash4.0 scripting was never my specialty, and now it just looks like greek to me.