PDA

View Full Version : driving me crazy! Error!



rdyeddy
August 2nd, 2009, 05:36 PM
Hi, I was following this tutorial:

But I keep getting this error message saying that there is a corrupt swf file which I have, of course, tried to delete then recompile.

Help please T.T

Alex Lexcuk
August 3rd, 2009, 10:11 AM
Hi, I was following this tutorial:

But I keep getting this error message saying that there is a corrupt swf file which I have, of course, tried to delete then recompile.

Help please T.T

Rain effect it's easy


package
{
import flash.display.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.events.*;
public class DocRain extends MovieClip
{
private const WIND:int = -200;
private const SPEED:Number = 0.5;
private var i:int,
moveX:Array,
moveY:Array;
public function DocRain()
{
i = 0;
moveX = [];
moveY = [];
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function enterFrameHandler(evt:Event):void {
fallDrop();
if (i>50) removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
i++;
}
private function drawDrop(_shape:Shape):void
{
with (_shape.graphics) {lineStyle(2, 0xddddff); beginFill( 0x0000FF, 1 );
drawEllipse(0, 0, 15+Math.random()*10, 15+Math.random()*10);endFill();}
}
private function fallDrop():void
{
var shape:Shape;
shape = new Shape();
shape.rotation = 180 - WIND;
addChild(shape);
if (WIND<0) shape.x=Math.random()*(550 + Math.abs(WIND));
else shape.x=Math.random()*(550 + Math.abs(WIND))-WIND;
shape.scaleX = shape.scaleY = 0.2+Math.random()*0.5;
drawDrop(shape);
shape.cacheAsBitmap = true;
moveX[i] = new Tween(shape, "y", None.easeNone, -10,
400,SPEED/shape.scaleX,true);
moveY[i] = new Tween(shape,"x",None.easeNone, shape.x,
shape.x+WIND,SPEED/shape.scaleX,true);
moveX[i].looping = true;
moveY[i].looping = true;
}
}
}