This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @see http://www.bloggingdeveloper.com/post/JavaScript-QueryString-ParseGet-QueryString-with-Client-Side-JavaScript.aspx | |
*/ | |
<script type="text/jscript" language="javascript"> | |
function getQuerystring(key, default_) | |
{ | |
if (default_==null) default_=""; | |
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); | |
var qs = regex.exec(window.location.href); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Rot:Number = 30; | |
mc.x += mc.height * Math.sin(Math.PI/180 * Rot)/2; | |
mc.y -= mc.width * Math.sin(Math.PI/180 * Rot)/2; | |
mc.rotation = Rot; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @see http://un-q.net/2010/02/new_class_as3_getqualifiedclassname.html | |
var a = getChildAt(0); // 参照があればなんでもおk | |
//どっちでもおk | |
//var className:String = describeType(a).@name; | |
var className:String = getQualifiedClassName(a); | |
var c:Class = Class(getDefinitionByName(className)); // これはクラスそのものなので、、これをaddChildしてもだめ。 | |
addChild(new c()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @see http://flashjp.com/as3/vector3.php | |
/* | |
ここではObject型の中身を持つVectorのソートをしてみます。 | |
先ほどと同様に使い慣れたArrayで実行してみます。 | |
このような場合、sortOnメソッドを使えば可能です。 | |
*/ | |
var arr:Array = new Array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* BitmapData のリサイズ | |
* | |
* @param BitmapData src 元となる BitmapData オブジェクト | |
* @param Number hRatio 水平方向のリサイズ比率 | |
* @param Number vRatio 垂直方向のリサイズ比率 | |
* @return BitmapData リサイズされた BitmapData オブジェクト | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _scaleX:Number = SRC_WIDTH/bmd.width; | |
var _scale:Number = (bmd.height*_scaleX>=SRC_HEIGHT)? _scaleX:SRC_HEIGHT/bmd.height; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* RGB値 と alpha値 を uint に変換します. | |
* @param r red [0,255] | |
* @param g green [0,255] | |
* @param b blue [0,255] | |
* @param a alpha [0,1] | |
*/ | |
private static function RGBtoValue( r:uint, g:uint, b:uint, a:Number=0 ):uint | |
{ | |
if( a>0 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
lazySymbolConverter for CS5 | |
@see http://f-site.org/articles/2008/12/14224253.html | |
@update 20120409 | |
*/ | |
// original copyrights | |
/*------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@author nowri.ka | |
@update 20120411 | |
*/ | |
var dom = fl.getDocumentDOM(); | |
var _library = dom.library; | |
var ____ct; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@see http://flashjp.com/as3/vector3.php | |
var vec:Vector.<Object> = new Vector.<Object>(); | |
vec[0] = { name:"apple" , price:98 }; | |
vec[1] = { name:"banana" , price:198 }; | |
vec[2] = { name:"chocolate" , price:148 }; | |
vec.sort(compareFunction); | |
function compareFunction(x:Object, y:Object):Number { |
OlderNewer