Action Script Will Not work above flash player 6 Please Help

Can some one please help me, I have been working with an old action script file that works in flash player 6 but not any thing above that. Any help would be great. And if some knows how to make it more efficient that would be great as well .As a side note the spline function no longer works either.

If I change the player version it works fine.

I have been staring at this for days…

onClipEvent (load) {
function x(t) {
var __reg1 = t;
if (__reg1 != 0 && __reg1 != 1) {
xspline = Math.pow(1-__reg1, 3)x0+3Math.pow(1-__reg1, 2)__reg1x1+3*(1-__reg1)*Math.pow(__reg1, 2)*x2+Math.pow(__reg1, 3)*x3;
}

if (__reg1 == 0) {
xspline = x0;
}

if (__reg1 == 1) {
xspline = x3;
}

return xspline;
}

function y(t) {
var __reg1 = t;
if (__reg1 != 0 && __reg1 != 1) {
yspline = Math.pow(1-__reg1, 3)y0+3Math.pow(1-__reg1, 2)__reg1y1+3*(1-__reg1)*Math.pow(__reg1, 2)*y2+Math.pow(__reg1, 3)*y3;
}

if (__reg1 == 0) {
yspline = y0;
}

if (__reg1 == 1) {
yspline = y3;
}

return yspline;
}

function evalangle(x1, y1, x2, y2, linedist) {
lineangle = Math.asin((y2-y1)/linedist)*180/3.14159;
if (x1-x2>0) {
lineangle = 180-lineangle;
}

return lineangle;
}

function drawLine(xp1, yp1, xp2, yp2, linedepth) {
var __reg1 = lineDepth;
_parent;
var __reg3 = xp1;
linedist = Math.sqrt((xp2-__reg3)(xp2-__reg3)+(yp2-yp1)(yp2-yp1));
lineangle = evalangle(__reg3, yp1, xp2, yp2, linedist);
_parent.attachMovie(“line”,“line”+__reg1,__reg1);
_parent[“line”+__reg1]._x = __reg3;
_parent[“line”+__reg1]._y = yp1;
_parent[“line”+__reg1]._rotation = lineangle;
_parent[“line”+__reg1]._xscale = 10*linedist;
}

function drawSpline() {
i = 0;
while (i<nsplinepoints) {
xpspline = x(t);
ypspline = y(t);
t = t+step;
++i;
}

i = 0;
while (i<nsplinelines) {
drawLine(xpspline,ypspline,xpspline[i+1],ypspline[i+1],i);
++i;
}

var t = 0;
}

function moveflower() {
_parent;
var crdzx = _parent._xmouse;
if (_parent._ymouse<0) {
var crdzy = _parent._ymouse;
}

if (crdzx>crdx) {
crdx = crdx+(crdzx-crdx)/20;
}

if (crdzx<crdx) {
crdx = crdx-(crdx-crdzx)/20;
}

if (crdzy>crdy) {
crdy = crdy+(crdzy-crdy)/20;
}

if (crdzy<crdy) {
crdy = crdy-(crdy-crdzy)/20;
}

if (crdx == 0) {
crdx = 1;
}

if (crdy == 0) {
crdy = 1;
}

distance = Math.sqrt(crdxcrdx+crdycrdy);
angle = Math.asin(crdx/distance)180/3.14159;
x3 = radius
crdx/distance;
y3 = radius*crdy/distance;
_parent.dragme._rotation = angle;
_parent.dragme._x = x3;
_parent.dragme._y = y3;
}

var nsplinepoints = 11;
var nsplinelines = nsplinepoints-1;
var step = 1/nsplinelines;
var t = 0;
var x0 = 0;
var x1 = 0;
var x2 = 0;
var y0 = 50;
var y1 = 33;
var y2 = 0;
var radius = 40;
var xpspline = [];
var ypspline = [];
}
onClipEvent (enterFrame) {
moveflower();
drawspline();
}

You might get a better response it you attach the fla. One thing that might help you is to check the case sensitivity in your code. For example, you have a function called draw[COLOR=“Red”]S[/COLOR]pline but you’re calling it with draw[COLOR=“red”]s[/COLOR]pline. That may well explain why it’s no longer working.

Sorry I realized I needed to change my user name.

I Caught the capital letter in the function after I posted, I fixed that still having the problem.

I am posting the fla

Thanks

If you change the player version to 7 or above it quits working

Only had a quick look at your code, but a few trace statements revealed lots of undefined and NaN outputs when I changed to Flash Player 7. For example, tracing xp2 in your drawLine function returns undefined, probably because the scope doesn’t exist in this functions particular timeline. Tracing xpspline returns Nan which is consistent as, from what I can see, this is an array. Later versions of the Flash Player are a lot stricter than earlier versions when it comes to datatyping. All I can suggest is that you continue inserting trace statements into your functions to find out exactly what values are being returned and alter your code accordingly.

Thank:
Im still at a loss, I wrote a similar script replacement for a client , but this one “works better” according to my client so I’m trying to make it work. Im afraid this one is a little beyond me.
Thanks