Hi,

I have a piece of code

It's a twisted rope like thing rotating.

When i publish(F8 actionscript2).

I've tried publishing with 4 and up, same problem

I get this

Any ideas?

**Error** Scene=Scene 1, layer=Action Layer, frame=1:Line 34: Identifier expected

var num = x[x] = {y: y, vx: 0, vy: 0, next: num + 1 == seg ? (0) : (num + 1), prev: num - 1 == -1 ? (seg - 1) : (num - 1), next2: num + 2 == seg ? (0) : (num + 2), 1: "prev2", num - 2 == -2 ? (seg - 2) : (num - 2): seg - 1};

Total ActionScript Errors: 1 Reported Errors: 1

AND HERE'S THE CODE(line 34 in red)

Bubble = function (mc, col, seg, size)

{

this.mc = mc;

this.col = col;

this.seg = seg;

this.radius = size / 2;

this.setUp();

};

Bubble.prototype.setUp = function ()

{

var mc = this.mc;

var seg = this.seg;

var as = 6.283185 / seg;

var r = this.radius;

var nodes = this.nodes = [];

var a = 0;

while (a < 6.283185)

{

var x = Math.cos(a) * r;

var y = Math.sin(a) * r;

var num = nodes.length;

if (num + 2 <= seg)

{

}

else

{

} // end if

if (num - 2 != -1)

{

}

else

{

} // end if

var num = x[x] = {y: y, vx: 0, vy: 0, next: num + 1 == seg ? (0) : (num + 1), prev: num - 1 == -1 ? (seg - 1) : (num - 1), next2: num + 2 == seg ? (0) : (num + 2), 1: "prev2", num - 2 == -2 ? (seg - 2) : (num - 2): seg - 1};

a = a + as;

} // end while

var dx = nodes[1].x - nodes[0].x;

var dy = nodes[1].y - nodes[0].y;

this.dd = Math.sqrt(dx * dx + dy * dy);

var dx = nodes[2].x - nodes[0].x;

var dy = nodes[2].y - nodes[0].y;

this.dd2 = Math.sqrt(dx * dx + dy * dy);

};

Bubble.prototype.render = function ()

{

var ten = -0.010000;

var rel = 0.990000;

var dd = this.dd;

var dd2 = this.dd2;

var r = this.radius;

var nodes = this.nodes;

for (var n in nodes)

{

var cn = nodes[n];

var nn = nodes[cn.next];

var pn = nodes[cn.prev];

var nn2 = nodes[cn.next2];

var pn2 = nodes[cn.prev2];

var cnx = cn.x;

var cny = cn.y;

var nnx = nn.x;

var nny = nn.y;

var pnx = pn.x;

var pny = pn.y;

var nn2x = nn2.x;

var nn2y = nn2.y;

var pn2x = pn2.x;

var pn2y = pn2.y;

var cnvx = cn.vx;

var cnvy = cn.vy;

var dx = nnx - cnx;

var dy = nny - cny;

var d = Math.sqrt(dx * dx + dy * dy);

var mx = dx / dd * d;

var my = dy / dd * d;

cnvx = cnvx + (dx - mx) * ten;

cnvy = cnvy + (dy - my) * ten;

var dx = pnx - cnx;

var dy = pny - cny;

var d = Math.sqrt(dx * dx + dy * dy);

var mx = dx / dd * d;

var my = dy / dd * d;

cnvx = cnvx + (dx - mx) * ten;

cnvy = cnvy + (dy - my) * ten;

var dx = nn2x - cnx;

var dy = nn2y - cny;

var d = Math.sqrt(dx * dx + dy * dy);

var mx = dx / dd2 * d;

var my = dy / dd2 * d;

cnvx = cnvx + (dx - mx) * ten;

cnvy = cnvy + (dy - my) * ten;

var dx = pn2x - cnx;

var dy = pn2y - cny;

var d = Math.sqrt(dx * dx + dy * dy);

var mx = dx / dd2 * d;

var my = dy / dd2 * d;

cnvx = cnvx + (dx - mx) * ten;

cnvy = cnvy + (dy - my) * ten;

var amp = 1.500000;

cnvx = cnvx + (Math.random() * amp - 0.500000 * amp);

cnvy = cnvy + (Math.random() * amp - 0.500000 * amp);

cnvx = cnvx - cnx / 222;

cnvy = cnvy - cny / 222;

(cn.vx = cnvx, cn.vy = cnvy);

} // end of for...in

var mc = this.mc;

mc.clear();

mc.lineStyle(1, 16763904, 100);

for (var n in nodes)

{

var node = nodes[n];

node.x = node.x + node.vx;

node.y = node.y + node.vy;

node.vx = node.vx * rel;

node.vy = node.vy * rel;

node.mc._x = node.x;

node.mc._y = node.y;

var n = Number(n);

var node = nodes[n];

var node_ = nodes[n - 1];

var nx = node.x;

var ny = node.y;

var px = node_.x;

var py = node_.y;

if (n == nodes.length - 1)

{

var n0 = nodes[0];

var n0_x = n0.x;

var n0_y = n0.y;

var sx = (nx + n0_x) / 2;

var sy = (ny + n0_y) / 2;

var ex = (nx + px) / 2;

var ey = (ny + py) / 2;

mc.moveTo(sx, sy);

mc.curveTo(nx, ny, ex, ey);

}

else if (n > 0)

{

var tx = (nx + px) / 2;

var ty = (ny + py) / 2;

mc.curveTo(nx, ny, tx, ty);

ex = (nx + px) / 2;

ey = (ny + py) / 2;

}

else

{

mc.curveTo(n0_x, n0_y, sx, sy);

} // end if

} // end of for...in

};

XJ = new Bubble(scene, 16763904, 16, 300);

onEnterFrame = function ()

{

XJ.render();

};

var i = 0;

while (i < 20)

{

XJ.render();

i++;

} // end while

Thanks again

Trinitee