flex gifloader
最近项目需要运用到FLEX,但GOOGLE一下发现可用的资料实在太少了。
找了好久发现google code上在这个还不错,还有很多东西可以好好研究研究
http://code.google.com/p/as3gif/
下面的例子是将动态GIF绑定到SPRITE上
package com.render
{
import flash.display.Sprite;
import flash.events.IOErrorEvent;
import flash.net.URLRequest;
import mx.core.Application;
import org.bytearray.gif.player.GIFPlayer;
public class SpriteWithBitmap extends Sprite
{
//Pass the source path or url here.
private static const defaultUrl:String = "/consoleweb/console/images/treewait.gif";
public function SpriteWithBitmap(url:String = defaultUrl)
{
loadImg(url);
}
private function loadImg(url:String):void
{
var gifPlayer:GIFPlayer = new GIFPlayer();
var request:URLRequest = new URLRequest(url);
gifPlayer.load(request);
gifPlayer.addEventListener(IOErrorEvent.IO_ERROR,loadFailure);
this.addChild(gifPlayer);
//设置图片居中显示
gifPlayer.x = Application.application.checkTree.width * 0.5 - 32;
gifPlayer.y = Application.application.checkTree.height * 0.5 -32;
}
private function loadFailure(event:IOErrorEvent):void
{
}
}
}
但要动态取到GIF的宽度还是没有头绪,在网上看到过这个
Hi, Thibault Imbert. The width/height property return 0, event after COMPLETE event dispatch. The GIFPlayerEvent has the ‘rect’, but it’s useless.
I’ve edited your GIFPlayer class (you should have done that).
All u needed 2 do is just to create a public var
public var rect:Rectangle;
And after in the readStream method to do so:
rect = aFrames[0].bitma
相关文档:
几日前被老总推荐文章一篇,来自7yue兄的blog,作者是Sean Moore ,
原文地址:http://www.insideria.com/2009/04/51-actionscript-30-and-flex-op.html
与其在程序写完了之后臃肿得跑不动,不如平时注意这些关键点,时时提醒自己。翻译出来,以便以后时时查阅。
1 创建新数组时避免使用它的构造函数。
......
flex中使用socket与其他语言(如Java)socket交互的例子。
自从Adobe Flash Player升级到9.0.124后,由于安全策略的修改,原来的socket连接方式将不能被使用,而必须采用新的安全策略方式来验证,具体的过程如下:
1.首先检测服务端的843端口是否提供安全策略文件;
&n ......
这是一个简单的工作流设计器模型,还不能用于实际项目,只是个人兴趣做一些技术学习与尝试。设计器支持一些工作流基本组件的绘制,如节点、路由线路等等。
整个设计器是纯Flex技术实现,未与数据库接口。采用Flex Builder 3.0开发,通过实践对Flex以下技术有了更进一 ......
环境:eclipse 3.5 + tomcat 6.0 + flex builder 3.0 + blazeds-turnkey-3.2.0.3978.zip(adobe网站上下载)
(因为不能放截图所以只能叙述了)
1,新建一个
java web
项目 例名为 :testjava;
2,在此工程中写一个简单的类:
package cn.com;
  ......