I do not like external files. Most developers prefer this and claim it is better. Explain why it's best to use classes in ActionScript 3.0.
My ActionScripts are different. I remove the classes and paste them into the Flash IDE. 9 out of 10 times works great. My question is Socrates, but I really feel ignorant about this because there is less code for what I'm trying to do. Enjoy it.
Here's a tutorial that I reviewed - “Keyboard Output Testing Example”
var _time_scale:Number = .25;
var _frames_elapsed:int = 0;
var _clip:MovieClip;
function handleEnterFrame(e:Event):void {
_frames_elapsed++;
_clip.gotoAndStop(Math.round(_clip.totalFrames * _frames_elapsed * _time_scale));
}
package {
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite {
private var _time_scale:Number = .25;
private var _frames_elapsed:int = 0;
private var _clip:MovieClip;
public function Main():void {
_clip = new SomeClip;
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
}
private function handleEnterFrame(e:Event):void {
_frames_elapsed++;
_clip.gotoAndStop(Math.round(_clip.totalFrames * _frames_elapsed * _time_scale));
}
}
}
There can be no answer, but there must be a definite explanation that makes sense.
anon255058
source
share