# Nice 3d particle explosion AS1 need to be in AS2

**URL:** <https://forum.kirupa.com/t/nice-3d-particle-explosion-as1-need-to-be-in-as2/249915>\
**Category:** Uncategorized\
**Created:** [January 23, 2008, 6:42pm UTC](https://forum.kirupa.com/t/nice-3d-particle-explosion-as1-need-to-be-in-as2/249915 "2008-01-23T18:42:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![satiss](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@satiss](https://forum.kirupa.com/u/satiss)\
**Post date:** [January 23, 2008, 6:42pm UTC](https://forum.kirupa.com/t/nice-3d-particle-explosion-as1-need-to-be-in-as2/249915/1 "2008-01-23T18:42:40Z")

</div>

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](http://www.robertpenner.com/experiments/sphere_burst.html)

Source:  
[http://www.robertpenner.com/experiments/flas/sphere\_burst.zip](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
