as3 textfield alpha

2011年7月25日 星期一 by Hu, Ching-Hsiang


txt.blendMode = BlendMode.LAYER;

Filed under having 0 意見  

AS3 distance between two points

2011年7月22日 星期五 by Hu, Ching-Hsiang

way 1

function DistanceTwoPoints(x1:Number, x2:Number, y1:Number, y2:Number):
Number {
var dx:Number = x1-x2;
var dy:Number = y1-y2;
return Math.sqrt(dx * dx + dy * dy);
}

way 2

var pt1:Point = new Point(circle1.x, circle1.y);
var pt2:Point = new Point(circle2.x, circle2.y);
var distance:Number = Point.distance(pt1, pt2);

Filed under having 0 意見  

as3 eventListener function with parameter

2011年6月2日 星期四 by Hu, Ching-Hsiang


mc.addEventListener(Event.COMPLETE,function(e : Event) : void{LoadedComplete(e, 'test' ,true);});
function LoadedComplete(e:Event,txt:String,switch:Boolean ):void{

}

Filed under having 0 意見  

css hack ie6, ie7, ie8, firefox

2011年5月18日 星期三 by Hu, Ching-Hsiang

css hack

Filed under having 0 意見  

clear DNS cache

2011年5月16日 星期一 by Hu, Ching-Hsiang

for win
in command line:

ipconfig /flushdns


for mac
in terminal

dscacheutil -flushcache

Filed under having 0 意見  

as3 embed youtube player fullscreen problem

by Hu, Ching-Hsiang


stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler);
function fullScreenHandler(e:FullScreenEvent) {
if(!e.fullScreen){ //you just returned back to normal
topMC.addChild(player);
player.setSize(640, 360)
}else{ //you just entered full screen mode
xxx.addChild(player);
player.setSize(stage.stageWidth, stage.stageHeight)
}
};

Filed under having 0 意見  

mc change depth to top

by Hu, Ching-Hsiang


this.setChildIndex(mc, this.numChildren-1)

Filed under having 0 意見