新公司的新年礼物
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1310
Warning: shuffle() expects parameter 1 to be array, null given in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1311
Warning: Invalid argument supplied for foreach() in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1312
Gtd笔记本一枚
该日志未加标签。好玩的活动~大家都来参加吧
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1310
Warning: shuffle() expects parameter 1 to be array, null given in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1311
Warning: Invalid argument supplied for foreach() in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1312
CPU优化大竞赛~
http://flash.9ria.com/thread-42637-1-1.html
好玩的活动啊大家来参加吧~
蛋疼的性能优化
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1310
Warning: shuffle() expects parameter 1 to be array, null given in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1311
Warning: Invalid argument supplied for foreach() in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1312
程序代码来之Advanced ActionScript Animation。 下面这个是没有优化过的
package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.text.TextField; import flash.text.TextFormat; [SWF(width=800, height=800, backgroundColor=0xffffff)] public class Container3D extends Sprite { private var _sprite:Sprite; private var _n:Number = 0; public function Container3D() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; _sprite = new Sprite(); _sprite.y = stage.stageHeight / 2; for(var i:int = 0; i < 100; i++) { var tf:TextField = new TextField(); tf.defaultTextFormat = new TextFormat("Arial", 40); tf.text = String.fromCharCode(65 + Math.floor(Math.random() * 25)); tf.selectable = false; tf.x = Math.random() * 300 - 150; tf.y = Math.random() * 300 - 150; tf.z = Math.random() * 1000; _sprite.addChild(tf); } addChild(_sprite); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(event:Event):void { _sprite.x = stage.stageWidth / 2 + Math.cos(_n) * 200; _n += .05; } } } |
加了行 cacheBitmap = true 后,少了20%这样
package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.text.TextField; import flash.text.TextFormat; [SWF(width=800, height=800, backgroundColor=0xffffff)] public class Container3D extends Sprite { private var _sprite:Sprite; private var _n:Number = 0; public function Container3D() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; _sprite = new Sprite(); _sprite.y = stage.stageHeight / 2; _sprite.cacheAsBitmap = true; for(var i:int = 0; i < 100; i++) { var tf:TextField = new TextField(); tf.defaultTextFormat = new TextFormat("Arial", 40); tf.text = String.fromCharCode(65 + Math.floor(Math.random() * 25)); tf.selectable = false; tf.x = Math.random() * 300 - 150; tf.y = Math.random() * 300 - 150; tf.z = Math.random() * 1000; _sprite.addChild(tf); } addChild(_sprite); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(event:Event):void { _sprite.x = stage.stageWidth / 2 + Math.cos(_n) * 200; _n += .05; } } } |
把所有的字母都draw成bitmap以后再加去显示对象里面,cpu 占用率奇迹般地只有10%了..
而且我发现,关掉鼠标事件很有必要…
package { import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.text.TextField; import flash.text.TextFormat; [SWF(width=800, height=800, backgroundColor=0xffffff)] public class Container3D extends Sprite { private var _sprite:Sprite; private var _n:Number = 0; public function Container3D() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; _sprite = new Sprite(); _sprite.y = stage.stageHeight / 2; _sprite.cacheAsBitmap = true; _sprite.mouseChildren = false; _sprite.mouseEnabled = false; for(var i:int = 0; i < 100; i++) { var tf:TextField = new TextField(); tf.defaultTextFormat = new TextFormat("Arial", 40); tf.text = String.fromCharCode(65 + Math.floor(Math.random() * 25)); tf.selectable = false; tf.width = tf.textWidth; tf.height = tf.textHeight; var bdd:BitmapData = new BitmapData(tf.width, tf.height, true, 0xFFFFFF); bdd.draw(tf); var bd:Bitmap = new Bitmap(bdd); bd.x = Math.random() * 300 - 150; bd.y = Math.random() * 300 - 150; bd.z = Math.random() * 1000; _sprite.addChild(bd); } addChild(_sprite); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(event:Event):void { _sprite.x = stage.stageWidth / 2 + Math.cos(_n) * 200; _n += .05; } } } |
xml..event 和xml.event
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1310
Warning: shuffle() expects parameter 1 to be array, null given in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1311
Warning: Invalid argument supplied for foreach() in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1312
下次谁再写第一种写法我和他急…
偷懒是不对的,特别是在父Node不同子Node相同的情况下…
该日志未加标签。chrome 为什么不能把插件也给漫游了..
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1310
Warning: shuffle() expects parameter 1 to be array, null given in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1311
Warning: Invalid argument supplied for foreach() in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1312
最近实在是很萌Chrome…私认为终于可以拜托firefox的超级无敌启动慢了。在下有点想不明白的就是,以云端为首的google,居然没有选项让chrome的插件/皮肤漫游,实在是想不明白…google输入法都有用户词典漫游了嘛…
不过服务这些东西,一旦被墙了,也就只好欲哭无泪了.. TAT
该日志未加标签。Flash自动导出资源脚本的策略问题
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1310
Warning: shuffle() expects parameter 1 to be array, null given in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1311
Warning: Invalid argument supplied for foreach() in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1312
1.资源名称带有Assets的就会被导出
2.把需要导出的放去一个文件夹里面,文件夹内的资源都会被使用linkage导出的状态。
不知道哪个好呢…
该日志未加标签。09年推荐书目
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1310
Warning: shuffle() expects parameter 1 to be array, null given in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1311
Warning: Invalid argument supplied for foreach() in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1312
一年里面看过的觉得还可以的书,有兴趣的人可以看看…里面去除了技术类的书(其实是我没怎么看..)小说类的话个人喜好太强烈,就不推荐了…有本叫《与神对话》,但是还没看,就不好推荐了。下面的书目包含各种各样的类别…大家可以根据自己的喜好看..后面的分类是自己分的…分错了,就无视吧…认真你就输了
物种起源 科普
万物简史 科普
量子物理学史话 科普
一口气读完世界历史 科普
全球通史 历史
正见——佛陀的证悟 神学
苏菲的世界 哲学
世界是平的 科普
杜拉拉升职记 管理
怎样把仓鼠变成化石 科普
欺骗的艺术 励志
中国不高兴 经济学
人体使用手册 保健
59秒 励志
世界上最会说话的人 励志/管理
走出软件作坊 管理
我不是教你诈 励志/管理
该日志未加标签。做网游的各位,想过自己的孩子会沉迷么…
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1310
Warning: shuffle() expects parameter 1 to be array, null given in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1311
Warning: Invalid argument supplied for foreach() in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1312
在大家大谈用户粘性的时候其实我很苦闷,策划们也想尽一切办法黏住用户,甚至在游戏宣传的时候就已经死命想着法子去吸引用户。只不过诸位以后看到自己几岁的小孩被自己做的游戏黏住的时候是什么样的感觉呢…
看着自己死命恶心做出来的游戏,想啊~啊,我的孩子也沉迷啦…我这个做老爸的魅力真是大啊…
其实,人的时间是非常有限的…世界太大,时间太少…诸位在做游戏的时候,顺便想想怎么让自己的孩子的童年不要和浪费人参的事情捆在一块吧..当你35 40的时候,你的身体还能带着你的孩子去游历祖国的美好河山么…可怜的程序员们……别亏待自己的身体啊(揍
该日志未加标签。中文的滚动不能用mask,只能用scrollRect,真恶心
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1310
Warning: shuffle() expects parameter 1 to be array, null given in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1311
Warning: Invalid argument supplied for foreach() in /home/.lemieux/huangjinwei/xflex.cn/blog/wp-content/plugins/simple-tags/inc/client.php on line 1312
mask要嵌入字体,哪个人有空给他嵌入差不多3M的字体啊…
以前一直做英文站没留意这事,这次好了,学乖了…
TweenMax.to(this.content, 0.5, {scrollRect:{y:0}, ease:Quint.easeIn} );
附送代码…
该日志未加标签。

