Browse > Home > Archive: 四月 2008

| Subcribe via RSS

WebORB:整合Flash/Flex与服务端的通讯平台

四月 28th, 2008 | No Comments , 330 views | Posted by flashlizi in Flex3

WebORB是一个免费的整合Flash/Flex与服务端(.NET/Java/Ruby/PHP)的通讯平台,它对AMF0,AMF3,RTMP,XML都有很好的支持。特别是.NET平台,推荐使用WebORB。

让timer事件不延迟第一次调度

四月 23rd, 2008 | No Comments , 303 views | Posted by flashlizi in Flash CS3/AS3

一般启动Timer对象创建计时器后,都要经过Timer.delay的延迟后才会第一次调度timer事件。不过有些时候,我们想不经过delay就第一次调度timer事件,因此我们可以扩展Timer类来实现:

package {
import flash.utils.Timer;
import flash.events.TimerEvent;
public class MyTimer extends Timer {
private var startDelay:Boolean;
public function MyTimer(delay:Number, repeatCount:int = 0, startDelay:Boolean = true) {
this.startDelay = startDelay;
super(delay, repeatCount);
}
public override function start():void {
if (!startDelay) dispatchEvent(new TimerEvent(TimerEvent.TIMER));
super.start();
}
}
}

使用方法:
//传入startDelay为false即不延迟调度timer事件
var timer:MyTimer = new MyTimer(1000, 5, false);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();

需要注意的是,不延迟第一次调度timer事件不会计入到计时器的总运行次数repeatCount的。即调度完第一次timer事件后,currentCount仍为0。

Flex SDK coding conventions and best practices

四月 16th, 2008 | No Comments , 279 views | Posted by flashlizi in Flex3

Adobe Open Source上发布的Flex SDK编程规范与实践。内容包括命名、编程惯用法、文件组织管理、代码格式、项目文档ASDoc等一系列的规范。致力于Flex/Flash开发的朋友都值得一看,这有助于你进行效率更高,可读性更好的开发。

URL: http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions

再推荐一篇关于FMS3的文章:Dynamic stream switching with Flash Media Server 3