Nice 3d particle explosion AS1 need to be in AS2

Hi, I’ve found an amazing 3d particle explosion, with a depth perspective. But it was created in AS1. When I tried to put it in AS2 I have an error message because the syntax is not compatible.

Preview
http://www.robertpenner.com/experiments/sphere_burst.html

Source:
http://www.robertpenner.com/experiments/flas/sphere_burst.zip

Here’s the error message:

Symbol=fireworks_, layer=Control, frame=1, Line 4: There is no property with the name ‘toDegrees’.
Math.toDegrees = function (theta) {

Symbol=fireworks_, layer=Control, frame=1, Line 8: There is no property with the name ‘toRadians’.
Math.toRadians = function (theta) {

Symbol=fireworks_, layer=Control, frame=1, Line 12: There is no property with the name ‘cosd’.
Math.cosd = function (theta) {

Symbol=fireworks_, layer=Control, frame=1, Line 13: There is no method with the name ‘toRadians’.
return Math.cos(Math.toRadians(theta));

Symbol=fireworks_, layer=Control, frame=1, Line 16: There is no property with the name ‘sind’.
Math.sind = function (theta) {

Symbol=fireworks_, layer=Control, frame=1, Line 17: There is no method with the name ‘toRadians’.
return Math.sin(Math.toRadians(theta));

Symbol=fireworks_, layer=Control, frame=1, Line 88: There is no method with the name ‘cosd’.
this.cosRY = Math.cosd(ry);

Symbol=fireworks_, layer=Control, frame=1, Line 89: There is no method with the name ‘sind’.
this.sinRY = Math.sind(ry);

Symbol=path–fragment, layer=actions, frame=1, Line 10: There is no method with the name ‘cosd’.
initVelX = iSpeed * Math.cosd(iTheta) * Math.sind(iPhi);

Symbol=path–fragment, layer=actions, frame=1, Line 11: There is no method with the name ‘sind’.
initVelY = iSpeed * Math.sind(iTheta) * Math.sind(iPhi) + 1.5;

Symbol=path–fragment, layer=actions, frame=1, Line 12: There is no method with the name ‘cosd’.
initVelZ = iSpeed * Math.cosd(iPhi);

Here’s a part of the code:
Math.toDegrees = function (theta) {
return theta * 180 / Math.PI;
}

Math.toRadians = function (theta) {
return theta * Math.PI / 180;
}

Math.cosd = function (theta) {
return Math.cos(Math.toRadians(theta));
}

Math.sind = function (theta) {
return Math.sin(Math.toRadians(theta));
}

Does someone have any clue how to fix it? :hugegrin:

Thanks