Can anyone help me converting this script to AS3
Dear all, Can anyone help me converting this script to AS3, i tried it but it's not worked as I'm no so good.
Stage.align = "TL";
Stage.scaleMode = "noScale";
bc._width = Stage.width; bc._height = Stage.height;
var bc = bc; Stage.addListener(bc); bc.onResize = function() { bc._width = Stage.width; bc._height = Stage.height; };
class balloons_class extends MovieClip {
private var speedMultiplier:Number = 5; private var viewWidth:Number = Stage.width; private var viewHeight:Number = Stage.height; private var speed:Number; private var drift:Number; function balloons_class() { readyBalloon(); moveMe(); } private function readyBalloon():Void { speed = 5 + Math.random() * speedMultiplier; getDrift(); this._y = viewHeight + this._height / 2; this._x = Math.random() * viewWidth; this._xscale = this._yscale = 70 + speed * 10; } private function getDrift():Void { drift = Math.random() * 3; var driftDirection:Number = Math.random() * 10; if (driftDirection < 5) { drift *= -1; } } private function moveMe():Void { this.onEnterFrame = everyFrame; } private function everyFrame():Void { this._y -= speed; this._x += drift; if (this._y < -this._height / 4) { viewWidth = Stage.width; viewHeight = Stage.height; readyBalloon(); } } }
class confetti_class extends MovieClip {
private var speedMultiplier:Number = 10; private var viewWidth:Number = Stage.width; private var viewHeight:Number = Stage.height; private var speed:Number; private var drift:Number; function confetti_class() { speed = Math.random() * speedMultiplier; readyConf(); moveMe(); } private function readyConf():Void { getDrift(); this._y = -50; this._x = viewWidth - 2 * Math.random() * viewWidth; this._xscale = this._yscale = 70 + speed * 10; } private function getDrift():Void { drift = Math.random() * 3; var driftDirection:Number = Math.random() * 10; if (driftDirection < 5) { drift *= -1; } } private function moveMe():Void { this.onEnterFrame = everyFrame; } private function everyFrame():Void { this._y += speed; this._x += drift; if (this._y > viewHeight+50) { viewWidth = Stage.width; viewHeight = Stage.height; readyConf(); } } }
I've spent 1-2 on that and still can't figure out how it can work. It will be huge help if anyone can help. Thank you in advance.
Sylvia
