-------------------------------------------------------------------------------------------------------------
CODE:
https://www.kirupa.com/developer/as3/colorful_explosion_page1.htm
https://www.kirupa.com/forum/showthread.php?352744-AS3-simple-explosion
--------------------------------------------------------------------------------------------------------------
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class ColorfulCircle extends MovieClip {
var radians:Number;
var speed:Number;
var radius:Number;
var originalX:Number;
var originalY:Number;
static var colorArray:Array = new Array(0xFFFF33, 0xFFFFFF, 0x79DCF4, 0xFF3333, 0xFFCC33, 0x99CC33);
public function ColorfulCircle() {
originalX = this.x;
originalY = this.y;
setProperties();
this.addEventListener(Event.ENTER_FRAME, flyCircleIn);
}
function setProperties(){
speed = Math.ceil(5*Math.random());
radius = 20*Math.random();
radians = 0;
trace(speed);
this.scaleX = 0;
this.scaleY = 0;
var randomColorID:Number = Math.floor(Math.random()*colorArray.length);
var myColor:ColorTransform = this.transform.colorTransform;
myColor.color = colorArray[randomColorID];
this.transform.colorTransform = myColor;
this.alpha = 1;
}
function flyCircleIn(e:Event) {
radians += Math.abs(speed/10);
this.x += Math.round(radius*Math.cos(radians));
this.y += Math.round(radius*Math.sin(radians));
this.scaleX += Math.abs(speed/10);
this.scaleY += Math.abs(speed/10);
this.alpha -= Math.abs(speed/100);
if (this.alpha < 0)
{
resetCircle();
}
}
function resetCircle(){
this.x = originalX;
this.y = originalY;
setProperties();
}
}
}
-------------------------------------------------------------------------------------------------------------
READ MORE:
http://flashcollege.blogspot.co.uk/2016/10/add-child-into-class-as3.html
--------------------------------------------------------------------------------------------------------------
MOVIE SYMBOL PROPERTIES CLASS AS3 - YouTube
https://www.youtube.com/watch?v=-beq_mz9CJg
31 Oct 2016 - Uploaded by SAVE MONEY
MOVIE SYMBOL PROPERTIES CLASS AS3 ... Reference Nested Movie Clips with ActionScript 3 in Flash CS5 ...ADDCHILD CLASS AND MAIN CLASS AS3 - YouTube
https://www.youtube.com/watch?v=duUthMFJGCQ
31 Oct 2016 - Uploaded by SAVE MONEY
http://flashcollege.blogspot.co.uk/2016/10/add-ch...MAIN CLASS AS3 - YouTube
https://www.youtube.com/watch?v=Ofm-bAGvIEk
4 Jun 2016 - Uploaded by SAVE MONEY
ADDCHILD CLASS AND MAIN CLASS AS3 - Duration: 4:45. SAVE MONEY 2 views. New. 4:45. MOVIE ...
1 comments:
Thank you!
EmoticonEmoticon