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
/** | |
* | |
* | |
* ScaleBitmap | |
* | |
* @author Didier Brun | |
* @author Jerôme Decoster | |
* @version 1.1 | |
* | |
*/ |
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
Monster Debugger is released under the GNU General Public License. | |
and GrantSkinner's document said this license is a "viral" license, | |
and our project use the debug tool, so... |
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
/** | |
* | |
* all code in timeline | |
* bitmapbutton test | |
* | |
* our project use raw bitmap to install button, so more btn resource is repeat | |
* use ScaleBitmap to reuse resource(like movieclip's scale9Grid) | |
*/ | |
import org.bytearray.display.ScaleBitmap; | |
import org.bytearray.display.ScaleBitmapSprite; |
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
//create a frame | |
var f:JFrame = new JFrame(this); | |
//...... | |
//some children add in this JFrame | |
f.show(); | |
//...... | |
//and final we dispose it | |
f.closeReleased(); //this method will call it's dispose() method | |
f = null; |
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
http://gskinner.com/blog/archives/2012/03/announcing-createjs.html | |
GrantSkinner's great job, and look at Zoë library, "It’s also worth mentioning here that Flash Pro CS6 will include direct support for exporting sprite sheets for EaselJS, offering a more integrated workflow than Zoë can provide." |
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
this is a case: | |
In a very large-size Movieclip (as a game 'map', roughly 4000(width) * 2000(height)), set this movieclip's property 'cacheAsBitmap' to true, and this mc has dozen children, when you start drag this mc, you could obviously feel 'mousemove' is not smooth, Even if you register the mousemove listener and handle 'updateAfterEvent' method. drag mc is still not smooth. (and worse the fps is slower). | |
so read adobe's API documentation, found the 'cacheAsBitmap' property has some pay attention points... | |
"The cacheAsBitmap property is best used with movie clips that have mostly static content and that do not scale and rotate frequently. " | |
so I think this maybe the reason why above example's mc drag is not smooth, because internal children is change it's propery(like, 'rotation' "x", "y") will handle entire root mc to recreate the bitmap cache. and the mouseEvent's method | |
'updateAfterEvent' will enforce flashplayer to redraw immediately in every mouseMove operation. |
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
//TODO | |
function rotateBits(values:uint, extent:int):uint{ | |
var offset:uint; | |
const bytesAll:int = 32; | |
if(extent == 0){ | |
return values; | |
} | |
extent = extent % bytesAll; | |
if(extent > 0){ | |
offset = values >>> (32 - extent); |
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
/** | |
* study from byteArray.org(about a as3 byteArray's Book) | |
*/ | |
import flash.utils.ByteArray; | |
var b:ByteArray = new ByteArray(); | |
b.writeUnsignedInt(1234); | |
b.writeUnsignedInt(uint.MAX_VALUE); | |
b.position = 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
/** | |
* The c point study notes | |
* below is a exchange two specified variable value case | |
*/ | |
//this function is do not return any value | |
//the two parameter is a pointer variable of type int | |
void exchangeNum(int *num1, int *num2){ | |
int t = *num1; | |
*num1 = *num2; |
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
//I use Bit101's Component framework(Window, Text, PushButton) to create a Alert Component | |
/** | |
* create a window and set size (this window couldn't be drag) | |
*/ | |
var alert:Window = new Window(this, 0, 0, "Alert"); | |
alert.draggable = false; | |
alert.setSize(300, 200); | |
/* |
OlderNewer