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
Ïà¹ØÎĵµ£º
Windows
ÉèÖû·Path¾³±äÁ¿,¼ÓÈëflexµÄSDkµÄbinĿ¼·¾¶£¬È磺f:\flex_sdk_3\bin¡£ÉèÖúÃÁËÖ®ºó£¬´ò¿ªÃüÁîÐУ¬¶¨Î»µ½ÏîĿĿ¼£¬ÊäÈëÈçÏÂÃüÁmxmlc ÏîÄ¿Ãû.mxml¡£Èç¹û´Ëʱ³öÏÖÁË“Error:could not find JVM”£¬ÕâʱÐèÒªÊÖ¶¯Ö¸¶¨JRE·¾¶£¬´ò¿ªFlex3 SDKµÄbinĿ¼£¬ÓÃÎı¾±à¼Æ÷´ò¿ªjvm. ......
//»ñµÃÆÁÄ»µÄ·Ö±æÂÊ
var
x:Number=Capabilities.screenResolutionX;
var
y:Number=Capabilities.screenResolutionY;
Alert.show(
"x="
+x+
"y="
+y);
µÚ¶þÖÖ·½·¨
Alert.show(stage.fullScreenWidth+
"=="
+stage.fullScreenHeight);
//»ñµÃstage£¨¹¤×÷Çø£ ......
AdobeÔÚ¿ª·¢Flex×îÓÐÀûµÄ¹¤¾ß¾ÍÊÇFlex Builder£¬È»¶ø£¬¹¤ÓûÉÆÆäÊ£¬±ØÏÈÀûÆä"¼ü"£¬¿ìËÙ¼ü¶ÔÒ»°ã¿ª·¢ÕßÀ´Ëµ¶¼·Ç³£ÓÐÓ㬷ǵ«Èç´Ë£¬ºÜ¶à¿ìËÙ¼üÓë×éºÏ¼üÊÇ»áÓëÆäËûÈíÌå»òϵͳ¶¼ÓÐÀ×֮ͬ´¦£¬¾Ù¸öÀý×ÓÀ´Ëµ£¬Ctrl + C¾ÍÊǸ´ÖÆ£¬Ctrl + V¾ÍÊÇÌùÉÏ£¬¿´¿´Ðí¶à×÷ҵϵͳÓë±à¼ÈíÌåÊDz»ÊǶ¼Ò»ÑùÄØ£¿ÈôÄãÓÐ×¢Òâµ½¾Í»á²»ÄÑ·¢ÏÖ£¬ÆäʵFlex ......
·Ï»°²»Ëµ£¬Ö±½Ó´úÂ벿·Ö´úÂëÕª³×ÔÍøÉÏ£¬ÔÚ´ËÏëÔ×÷Õß±íʾ¸Ðл
1¡¢·þÎñ¶Ë uploadFile.ashx
<%@ WebHandler Language="VB" Class="UploadFile" %>
Imports System
Imports System.Web
Imports System.Web.HttpServerUtility
Imports System.IO
Imports System.Web.HttpRequest
Public Class UploadFile : Impl ......