Vector.unshift bug已修复

2009年8月7日 没有评论
package  
{
    import flash.display.Sprite;
    import flash.system.Capabilities;

    /**
     * www.litefeel.com
     * lite3@qq.com
     * @author lite3
     */
    public class VectorTest extends Sprite
    {

        private var list:Vector.<MyClass> = new Vector.<MyClass>();

        public function VectorTest() 
        {
            trace(Capabilities.version);
            var n:int = 3;
            while (n--)
            {
                //list.length++;
                list.unshift(new MyClass());
                trace(list);
            }
        }

    }

}
class MyClass{}

输出:

WIN 10,0,22,87
[object MyClass]
[object MyClass],[object MyClass]
[object MyClass],[object MyClass],[object MyClass]
标签: , , ,

蚁巢乐园 onlyant.com 搜狗拼音皮肤

2009年8月6日 没有评论

蚁巢乐园官方网站 已经不能打开了,这里就不贴网址了. 蚁巢乐园搜狗拼音皮肤下载: 本站下载 搜狗下载地址:http://pinyin.sogou.com/skins/search.php?word=%D2%CF%B3%B2

蚁巢乐园搜狗拼音皮肤 onlyant.com

蚁巢乐园搜狗拼音皮肤 onlyant.com

Array Vector 性能测试

2009年8月6日 没有评论

想做个对象池,以降低CPU销毁,以前都是用Array做的。
帮助上说flashplayer10的Vector速度要比Array的速度快的多今天特来测试下。
不过测试结果令我大失所望。

  1. push Vector慢,   Array 快  (可以忽略)
  2. pop : Vector快,   Array 慢 (可以忽略)

这样的结果让我对Vector的性能产生了怀疑,又测试了下Vector的的存取速度。

  1. 读取 Vector快,   Array 慢  (可以忽略)
  2. 存储Vector慢,   Array 快 (可以忽略)

看来Vector在对Array的性能较量中并不占优势。
只是Vector是单一元素类型的数组,拥有Array所没有的类型检查。

结论:做对象池还是用Vector吧,不管性能了。

下面是测试代码:
阅读全文...

ASDoc tags 文档注释标签详解

2009年7月31日 1 条评论

转至Adobe:http://livedocs.adobe.com/flex/3/html/index.html?content=asdoc_9.html

ASDoc tag Description Example
@copy reference Copies an ASDoc comment from the referenced location. The main description, @param, and @return content is copied; other tags are not copied. You typically use the @copy tag to copy information from a source class or interface not in the inheritance list of the destination class. If the source class or interface is in the inheritance list, use the @inheritDoc tag instead. You can add content to the ASDoc comment before the @copy tag. Specify the location by using the same syntax as you do for the @see tag. For more information, see Using the @see tag. @copy #stop @copy MovieClip#stop
@default value Specifies the default value for a property, style, or effect. The ASDoc tool automatically creates a sentence in the following form when it encounters an @default tag: The default value is value. @default 0xCCCCCC
@eventType package.class.CONSTANT @eventType String Use the first form in a comment for an [Event] metadata tag. It specifies the constant that defines the value of the Event.type property of the event object associated with the event. The ASDoc tool copies the description of the event constant to the referencing class. Use the second form in the comment for the constant definition. It specifies the name of the event associated with the constant. If the tag is omitted, ASDoc cannot copy the constant's comment to a referencing class. See Documenting effects, events, and styles
@example exampleText Applies style properties, generates a heading, and puts the code example in the correct location. Enclose the code in <listing version="3.0"></listing> tags. Whitespace formatting is preserved and the code is displayed in a gray, horizontally scrolling box. @example The following code sets the volume level for your sound: <listing version="3.0"> var mySound:Sound = new Sound(); mySound.setVolume(VOL_HIGH); </listing>
@exampleText string Use this tag in an ASDoc comment in an external example file that is referenced by the @example tag. The ASDoc comment must precede the first line of the example, or follow the last line of the example. External example files support one comment before and one comment after example code. /** * This text does not appear * in the output. * @exampleText But this does. */
@inheritDoc Use this tag in the comment of an overridden method or property. It copies the comment from the superclass into the subclass, or from an interface implemented by the subclass. The main ASDoc comment, @param, and @return content are copied; other tags are not. You can add content to the comment before the @inheritDoc tag. When you include this tag, ASdoc uses the following search order: 1. Interfaces implemented by the current class (in no particular order) and all of their base-interfaces. 2. Immediate superclass of current class. 3. Interfaces of immediate superclass and all of their base-interfaces. 4. Repeat steps 2 and 3 until the Object class is reached. You can also use the @copy tag, but the @copy tag is for copying information from a source class or interface that is not in the inheritance chain of the subclass. @inheritDoc
@internal text Hides the text attached to the tag in the generated output. The hidden text can be used for internal comments. @internal Please do not publicize the undocumented use of the third parameter in this method.
@param paramName description Adds a descriptive comment to a method parameter. The paramName argument must match a parameter definition in the method signature. @param fileName The name of the file to load.
@private Exclude the element from the generated output. To omit an entire class, put the @private tag in the ASDoc comment for the class; to omit a single class element, put the @private tag in the ASDoc comment for the element. @private
@return description Adds a Returns section to a method description with the specified text. ASDoc automatically determines the data type of the return value. @return The translated message.
@see reference [displayText] Adds a See Also heading with a link to a class element. For more information, see Using the @see tag. Do not include HTML formatting characters in the arguments to the @see tag. @see flash.display.MovieClip
@throws package.class.className description Documents an error that a method can throw. @throws SecurityError Local untrusted SWFs may not communicate with the Internet.
标签: , ,

相册 showgirl

2009年7月31日 没有评论

以前写的AS的相册,一直没有完成, 今天群里看到一个挺不错的相册,就先拿来用了, 貌似 CPU占用有点高, 有时间了再改下,O(∩_∩)O~ 相册里有好些 show girl 和 cosplay啊, 25号在上海ChinaJoy 会展拍的 :roll: 原照片太大,不适合放web上, 可经我压缩后, 体积确实小了,同时质量也降下来了 :???: 先将就着看吧, 想看原照片的发email 或留言, 我好email去 :razz:

dispatchEvent

2009年7月29日 2 条评论

有时,有些模块化的东西,要发送事件,如果当然没人侦听它,它却去发送事件不是有点浪费。
有个折中的办法,感谢 tttt 提醒用 willTrigger,willTrigger才能检测事件流里是否有注册相应事件。

注意:不要乱用,因为当事件流的层次多时,willTrigger消耗的时间是dispatchEvent的一多半!

override public function dispatchEvent(event:Event):void
{
    if (willTrigger(event.type))
    {
        super.dispatchEvent(event);
    }
}

Error creating AIR file: 303

2009年7月27日 没有评论

缺少某个文件,比如我的16x16.png 找不到, 在icon目录里,它居然好好的躺在那里, :mrgreen: 见鬼了, 又在发布的第2步 Included files 里找不到16x16.png 阅读全文...

标签: ,

MyEclipse flex 工具栏 图标

2009年7月21日 没有评论

用 MyEclipse 一段时间后发现 flex编译的3个图标不见了, google下,O(∩_∩)O~
选择 Window -> Customize Perspective... -> Commands -> 勾选 Launch ,确定 ok了
阅读全文...

标签: , ,

位操作:设置、取消 位

2009年7月8日 3 条评论

有时候需要用到并列的状态。

// 都是正数才管用的
var n:int = 5; 

// 设置位 
n |= flag;
// 取消位
~flag & n;
// 获取位
n & flag;
标签: , ,

AIR 模式化窗口

2009年7月6日 5 条评论

做地图编辑器的时候,要用到模式窗口,于是乎 : Google,baidu,qq齐上阵。
经过一下午的努力,终于解决了.其实方法蛮简单的,只是一时糊涂,没想到,放代码上了。

代码放到了我在github的类库里,请看 com.litefeel.utils.NatiaveWindowUtil 的源码。

标签: ,
回到顶部