X-Intend[超级打算]
每个人都有自己的想法,哪怕仅仅一瞬间~!

[原]关于AS3的MovieClip的addFrameScript()方法个人理解

2008年09月04日 作者: KingFo 原创

网络上都早有了此方法的描述,但是描述的并不太在正确
网络的描述是这样的:
 

  1. addFrameScript(frame:unit,notify:Function):void


相信很多人都尝试过以下输出公共方法的函数
 

  1. describeType(); 

所以通过解析可以明显的看出来是类似:
 

  1. addFrameScript(...args):void

可以理解成为:
 

  1. addFrameScript(frame:Object, notify:Function):void

实际上我的猜测是

 

  1. //伪码  
  2. function addFrameScript(..args):void{  
  3.     var i:int=0;  
  4.     var frame:Object  
  5.     var notify::Function  
  6.     for(;i<args.length;i+=2){  
  7.        frame=args[i];  
  8.        notify=args[i+1];
  9.  //TODO:  
  10.  }  
  11.  

 用法:
 

  1. addFrameScript("frameLabel",func);  
  2. //或  
  3. addFrameScript(1,func); 

 

被阅 417 次, 0 票  发表评论

Alternativa3D 5.0.3 and Flash Player 10 version

2008年08月02日 作者: KingFo 新闻

Alternativa3D 5.0.3 and Flash Player 10 version

31.07.2008 Anton Volkov

There is the Alternativa3D 5.0.3 update on the site.

Changelog:

  • OBJ-models loader added
  • Mesh setMaterialToAllSurfaces method renamed to cloneMaterialToAllSurfaces
  • Method close added to Loader3DS, manually interrupting uploading
  • Texture parameters made only for reading
  • Bug fixed - there were no redrawing after faces UV-coordinates update
  • Added indication of missing or incorrect UV-mapping doing texture drawing
  • Optimized memory usage for collision detection
  • Documentation updated

Since this version there will be two versions of Alternativa3D in our package, adapted for Flash Player 9 and 10 accordingly.

Also our documentation now can be integrated into Eclipse as a plug-in. It can be install directly from Eclipse, by setting address http://help.alternativaplatform.com as an update website.

Eclipse 3.3: Help > Software Updates > Find and Install > Search for new features to install > New Remote Site…

Eclipse 3.4: Help > Software Updates > Available Software > Add Site…

 

被阅 389 次, 0 票  发表评论

[原]关于股子系统的优化

2008年06月25日 作者: KingFo 原创

参考:
DiceClass
原作者:
hexagonstar : http://www.hexagonstar.com/
详情:
http://bbs.actionscript3.cn/thread-2044-1-1.html
程序结构:
Dice+ArrayUtil+NumberUtil,全静态类
个人评论:
NumberUtil内数值方面的是最值得借鉴的部分。

由于目前本人Dice 需要应用于DND System中,所以改变了下结构和随机算法(目的在于工厂化生产Dice,以及Dice随机分布算法抽出方便以后采用不同的随机分布算法。)
 

  1. //系统结构伪码  
  2. Dice implements IDice;  
  3. RandomSystem implements IRandomSystem  
  4. Random48 extends RandomSystem;  
  5.  
  6. interface IRandomSystem {  
  7.     function random(min:Number, max:Number):Number;  
  8.     function randomByRound(min:Number, max:Number,round:int):Array;  
  9. }  
  10.  
  11. interface IDice  {  
  12.     function get sided():int;  
  13.     function roll(round:int, randomSystem:IRandomSystem):DiceArrayList;  
  14.     function toString():String   
  15. }  
  16.  
  17. class DiceArrayList extends com.xintend.as3.dnd.core.ArrayCollection {         
  18.     public function DiceArrayList(data:Array ) {              
  19.     }  
  20.           
  21.     public function get average():int {     }  
  22.     public function get max():int {     }  
  23.     public function get min():int {     }  
  24.     public function get sum():int {     }  
  25.           
  26.     protected function verifyInt():void {}  
  27. }  
  28.          

(测试类):
 

  1. package {  
  2.       
  3.     import com.xintend.as3.dnd.base.dice.Dice;  
  4.     import com.xintend.as3.dnd.util.Random48;  
  5.     import com.xintend.as3.dnd.util.RandomSystem;  
  6.     import flash.display.Sprite;  
  7.       
  8.     public class Main extends Sprite    {  
  9.         public function Main(){           
  10.             var d1:Dice = new Dice(4);  
  11.             trace(d1.roll(100,new Random48()))  
  12.             trace(d1.roll(100,new RandomSystem()))  
  13.         }  
  14.     }  

测试图(结构在output窗口):


再次感谢hexagonstar.com开源的DiceClass中的48位线性同余算法

被阅 421 次, 0 票  发表评论
3 / 6 / 16 | « 1 2 3 4 5 6 » |

Google 网上论坛
订阅 XIntend
电子邮件:
访问此论坛

文章分类

站点统计

  • 文章总数: 87 篇
  • 评论总数: 6 条
  • 附件总数: 53 个
  • 留言总数: 0 份
  • 建站日期: 2008-1-1
  • 访问总数: 96228 人次

最新留言

赞助商

友情链接

Design by Free CSS Templates & TiSkin, Powered by Roclog v3.2.13

滇ICP备05000389号, Copyright © 2007 X-Intend[超级打算]. All rights reserved.