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 ´´½¨ÐÂÊý×éʱ±ÜÃâʹÓÃËüµÄ¹¹Ô캯Êý¡£
......
//»ñµÃÆÁÄ»µÄ·Ö±æÂÊ
var
x:Number=Capabilities.screenResolutionX;
var
y:Number=Capabilities.screenResolutionY;
Alert.show(
"x="
+x+
"y="
+y);
µÚ¶þÖÖ·½·¨
Alert.show(stage.fullScreenWidth+
"=="
+stage.fullScreenHeight);
//»ñµÃstage£¨¹¤×÷Çø£ ......
·Ï»°²»Ëµ£¬Ö±½Ó´úÂ벿·Ö´úÂëÕª³×ÔÍøÉÏ£¬ÔÚ´ËÏëÔ×÷Õß±íʾ¸Ðл
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 ......
flexºÍC++·þÎñÆ÷ͨÐÅ¡£ÒòΪ°²È«É³Â©ÎÊÌ⣬µ±swfλÓÚA·þÎñÆ÷£¬C++·þÎñÆ÷³ÌÐòλÓÚB·þÎñÆ÷ʱ¡£
ÕâʱswfºÍB·þÎñÆ÷½¨Á¢Socket½¨Á¢Á¬½Ó»á²úÉú¿çÓòÎÊÌâ¡£
½â¾ö·½·¨ÈçÏÂ
swf½¨Á¢socketʱ»áÏÈ·¢ÆðÒ»¸öÇëÇó¿çÓòÎļþµÄÇëÇó:"<policy-file-request/>"
·þÎñÆ÷½ÓÊÕµ½ºó·¢ËÍ×Ö·û´®
<?xml version="1.0"?>
<cross-doma ......