Converting AS1 to AS3. Please help me
Copy link to clipboard
Copied
I'm working on converting an old flash using AS1 into AS3. Please tell me if exists any software solution for this. This is the code:
steps = 10;
fscommand ("allowscale","false");
fscommand ("Showmenu","false");
Playmusic = true;
Motorlyd = new Sound();
Motorlyd.attachSound("motorlyd");
motorlyd.setVolume(0);
blink = 1;
rotation = 90;
_root.Rotation = -90
gotoAndPlay (5);
diff = Math.abs(this._rotation - _root.rotation); | ||
if( diff < 10) {Hast = 2} | ||
if( diff > 10) {Hast = 10} | ||
if( diff > 30) {Hast = 30} |
if (this._rotation > _root.rotation) { This._rotation = This._rotation - Hast} | |
if (this._rotation < _root.rotation) { This._rotation = This._rotation + Hast} | |
//_root.tester2._rotation = (180 / 100) * faderval; |
gotoAndPlay (2);
on (press) {
startDrag ("", false,_X, 28,_x, 198);
}
on (release) {
stopDrag ();
fader = int(100-((_y -28) / 1.70));
_root.var1 = 85 + (0.89 * (100-fader));
faderval = fader;
fader = fader +'%';
_root.blink = 0;
_root.vagten.gotoAndStop(1);
_root.vagten.play(1);
//_root.tester2._y = 150 - faderval;
_root.Rotation = 30 - (180 / 101) * faderval;
}
Copy link to clipboard
Copied
var steps:int = 10;
fscommand ("allowscale","false");
fscommand ("Showmenu","false");
var Playmusic:Boolean = true;
var Motorlyd:Sound = new motorlyd();
//motorlyd.setVolume(0);
var blink:int = 1;
var rotation:int = 90;
MovieClip(root).rotation = -90
//gotoAndPlay (5);
var Hast:int;
var diff:int = Math.abs(this.rotation - MovieClip(root).rotation);
if( diff < 10) {Hast = 2}
if( diff > 10) {Hast = 10}
if( diff > 30) {Hast = 30}
if (this._rotation > MovieClip(root).rotation) { this.rotation = this.rotation - Hast}
if (this._rotation < MovieClip(root).rotation) { this.rotation = this.rotation + Hast}
gotoAndPlay (2);
var rect:Rectangle=new Rectangle(this.x,28,0,170);
this.addEventListener(MouseEvent.MOUSE_DOWN,startdragF)
function startdragF(e:MouseEvent):void{
this.startDrag(false,rect);
stage.addEventListener(MouseEvent.MOUSE_UP,stopdragF);
}
function stopdragF(e:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_UP,stopdragF);
this.stopDrag ();
var fader:String = String(int(100-((_y -28) / 1.70)));
MovieClip(root).var1 = 85 + (0.89 * (100-int(fader)));
var faderval:int = int(fader);
fader = fader +'%';
MovieClip(root).blink = 0;
//MovieClip(root).vagten.gotoAndStop(1);
MovieClip(root).vagten.gotoAndPlay(1);
//_root.tester2._y = 150 - faderval;
MovieClip(root).rotation = 30 - (180 / 101) * faderval;
}
p.s. that is terrible coding even by as1 standards.

