FlawlessDog
May 16th, 2009, 04:23 PM
Ok…
This little Adobe air app represents my very first try at air, and a AS2 to AS3 conversion.
Wasn’t too hard to grasp. Been shying away from as3, but now seemed like a good time to start at least trying. Who knows…I may find a use for this knowledge.
Took one of my old SWiSHMax clocks written in an earler version of AS, and ported it into flash cs4, and AS3 , and exported this useless thing. Cool, huh? LOL
The clock script:
var mil:Number;
var s:Number;
var ss:Number;
var m:Number;
var mm:Number;
var h:Number;
var hh:Number;
var secondshand:MovieClip;
var minutshand:MovieClip;
var hourshand:MovieClip;
this.addEventListener(Event.ENTER_FRAME,EnterFrame );
function EnterFrame(event:Event):void {
//this.onEnterFrame = function() {
var time:Date= new Date();
mil = time.getMilliseconds();
s = time.getSeconds();
ss = int(s*6+(mil/(1000/6)));
secondshand.rotation = ss;
m = time.getMinutes();
mm = m*6+(s/10);
minutshand.rotation = mm;
h = time.getHours();
hh = h*30+(m/2);
hourshand.rotation = hh;
};
stop();
The main timeline script:
myClock.addEventListener(MouseEvent.MOUSE_DOWN, movWin);
closeBtn.addEventListener(MouseEvent.CLICK, onCloseWindow);
function movWin(e:Event):void{
stage.nativeWindow.startMove();
}
function onCloseWindow(event:MouseEvent):void{
this.stage.nativeWindow.close();
}
stop();
What do you think?
This little Adobe air app represents my very first try at air, and a AS2 to AS3 conversion.
Wasn’t too hard to grasp. Been shying away from as3, but now seemed like a good time to start at least trying. Who knows…I may find a use for this knowledge.
Took one of my old SWiSHMax clocks written in an earler version of AS, and ported it into flash cs4, and AS3 , and exported this useless thing. Cool, huh? LOL
The clock script:
var mil:Number;
var s:Number;
var ss:Number;
var m:Number;
var mm:Number;
var h:Number;
var hh:Number;
var secondshand:MovieClip;
var minutshand:MovieClip;
var hourshand:MovieClip;
this.addEventListener(Event.ENTER_FRAME,EnterFrame );
function EnterFrame(event:Event):void {
//this.onEnterFrame = function() {
var time:Date= new Date();
mil = time.getMilliseconds();
s = time.getSeconds();
ss = int(s*6+(mil/(1000/6)));
secondshand.rotation = ss;
m = time.getMinutes();
mm = m*6+(s/10);
minutshand.rotation = mm;
h = time.getHours();
hh = h*30+(m/2);
hourshand.rotation = hh;
};
stop();
The main timeline script:
myClock.addEventListener(MouseEvent.MOUSE_DOWN, movWin);
closeBtn.addEventListener(MouseEvent.CLICK, onCloseWindow);
function movWin(e:Event):void{
stage.nativeWindow.startMove();
}
function onCloseWindow(event:MouseEvent):void{
this.stage.nativeWindow.close();
}
stop();
What do you think?