Thursday, July 03, 2008

Visit my new Actionscript 3 blog

I will no longer be adding to this blog because I have started a new blog for Actionscript 3: http://mattmaxwellas3.blogspot.com/

I will still leave this blog up because it contains valuable info for AS2.

Friday, January 18, 2008

Mouse Wheel Scroll

var mouseListener:Object = new Object();
mouseListener.onMouseWheel = function(delta) {
trace(delta/3);
//result is 1 for up and -1 for down
}
Mouse.addListener(mouseListener);

Wednesday, January 16, 2008

Drag Clock Hands in Circular Motion

Thanks Dave Stiller for this snippet. His instructions are here.

mcMinute.onPress = function() {
this.onMouseMove = function() {
var angle:Number = Math.atan2(
mcFace._ymouse - mcFace._height / 2,
mcFace._xmouse - mcFace._width / 2
);
this._rotation = (angle * 180 / Math.PI) + 90;
};
};
mcMinute.onRelease = function() {
delete this.onMouseMove;
};
mcMinute.onReleaseOutside = mcMinute.onRelease;