Mis segundo disparo!! espero les agrade!!
es importante poner
100 fotogramas por segundo Código PHP:
var cont:MovieClip = this.createEmptyMovieClip("c", 0);
var x:Number = 0;
var y:Number = 0;
var a:Number = 2;
var n:Number = 5;
var bol:Boolean = true;
var listener:Object = new Object();
Mouse.addListener(listener);
this.createTextField("texto", 1, Stage.width/2-80, Stage.height/2+80, 300, 100);
var form:TextFormat = new TextFormat();
form.font = "arial";
form.size = 10;
form.color = 0x666666;
texto.text = "Formando imagen, espera...";
texto.setTextFormat(form);
cont._x = Stage.width/2;
cont._y = Stage.height/2;
cont.onEnterFrame = function():Void {
this._rotation -= 5;
if (a<74) {
a++;
x = 80*Math.sin(a*42);
y = 80*Math.cos(a*42);
if (a<20) {
cont.moveTo(x, y);
}
cont.lineStyle(0.5, 0x999999, 60);
cont.lineTo(x, y);
}else{
if (a++<200) {
a++;
x = 40*Math.sin(a*-15);
y = 40*Math.cos(a*-15);
if (bol) {
cont.lineStyle(1, 0x999999, 40);
bol = false;
} else {
cont.lineStyle(1, 0x999999, 40);
bol = true;
}
cont.curveTo(x*0.5, y*0.5, 0, 0);
cont.lineTo(x, y);
}else if(a < 350){
texto.text = "Imagen Completa...";
texto.setTextFormat(form);
}
}
if(a>=350){
if(this._xscale>30){
Mouse.hide();
texto.text = "Click donde quieras!!";
texto.setTextFormat(form);
this._xscale = this._xscale-2;
this._yscale = this._xscale;
}
}
}
listener.onMouseMove = function():Void{
if(a>400){
cont._x = _xmouse;
cont._y = _ymouse;
}
}
listener.onMouseDown = function():Void{
if(a>400){
disparar(cont.duplicateMovieClip("disparo"+n,n));
n++;
}
}
function disparar(mc:MovieClip):Void{
var d:Number = 0.5;
var asig:Boolean = false;
var dir:Number;
dir = Math.floor(Math.random()*4) + 1;
mc.onEnterFrame = function():Void{
this._rotation += 5;
this._xscale-=5;
d = d*1.2;
switch(dir){
case 1 : this._x += d;
this._y += d;
break;
case 2 : this._x -= d;
this._y -= d;
break;
case 3 : this._x -= d;
this._y += d;
asig = true;
break;
case 4 : this._x += d;
this._y -= d;
asig = true;
break;
}
if(this._x > Stage.width || this._y > Stage.height || this._y < 0 || this._x < 0){
this.removeMovieClip();
}
}
}
have funnnnnnn