flex 加载gif图片
使用到的as3gif,请到Google去下载
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" xmlns:file="file.*" xmlns:commont="commont.*">
<mx:TitleWindow title="abc" id="ADwindow" width="400" height="283" >
<mx:Image id="gifImg" width="221" height="92" creationComplete="init()"/>
<mx:Image id="gifImg2" width="224" height="101" creationComplete="init2()"/>
</mx:TitleWindow>
<mx:Script>
<!--[CDATA[
import org.bytearray.gif.player.GIFPlayer;
private var gifPlay:GIFPlayer=new GIFPlayer();
private var gifPlay2:GIFPlayer=new GIFPlayer();
private function init():void{
var req:URLRequest=new URLRequest("assets/logo.gif");
gifPlay.load(req);
gifImg.addChild(gifPlay);
}
private function init2():void{
var img:URLRequest=new URLRequest("assets/diego.gif");
gifPlay2.load(img);
gifImg2.addChild(gifPlay2);
}
]]-->
</mx:Script>
</mx:Application>
相关文档:
flashbuilder中可以建立flex工程与actionscript工程.
flex工程内可以使用mxml是完成设计工作.
actionscript工程建立时默认只有:
playerglobal.swc
flex.swc
utilities.sec
playerglobal.swc
这几个类库.没有framework.swc,就无法使用Button等控件了.
解决方案是 actionscript工程中加入framework.swc.
路径是 x:/A ......
Flex里面,DataGrid的column的width属性不接受百分比,只接受一个具体的像素值,所以,如果想按照比例来设置列宽需要费些周折。Google了一下,有两种方法可以做到: 第一种方法,不要设置width为百分比,而设置为一个小数,所有列的小数值的和必须为1。 <mx:DataGrid width="100%" height="100%" ......
用Flex4加载Flex3的组件时,发现了这个问题:
当用spark添加一个mx组件时不会有问题,但当这个mx组件中还有其他组件
例如<mx:HBox><mx:Canvas/></mx:HBox>被添加到<s:Group></s:Group>
(注:通过AS代码使用addElement()添加,而不是直接写到mxml中)
stage.frameRate会瞬间达到1000!
之 ......
1:http://bbs.9ria.com/viewthread.php?tid=44441
2:http://help.adobe.com/en_US/flex/using/WSA95C9644-B650-4783-B5C0-D2C7F95A23E3.html#WS46970071-A39D-49de-B881-66F639787305
3:http://flex4jiaocheng.com/blog/268
4:http://www.k-zone.cn/zblog/post/flash-builder-gumbo-customer-sparkskin.html
5:htt ......