SWFthrogugh AS3 から PNG 画像を生成しようとしましたが、機能しません...何が問題だったのか教えてください...
package {
import com.adobe.images.PNGEncoder;
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.IEventDispatcher;
import flash.net.URLRequest;
import flash.utils.ByteArray;
import flash.net.URLLoader;
import flash.net.URLVariables;
import com.dynamicflash.util.Base64;
import flash.net.URLRequestMethod;
import flash.net.URLLoaderDataFormat;
import flash.net.navigateToURL;
import flash.net.FileReference;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
public class SampleCircle extends Sprite
{
public var loader:Loader;
public var loaderA:Loader;
public var ba: ByteArray;
public function SampleCircle()
{
drawSWF();
}
public function drawSWF():void
{
var request:URLRequest = new URLRequest("E:/Workbook/swftoimage_visual_c_sharp/bin/Debug/dw_mxml_ar_kaplab_treemap_chartAAA.swf");
loader = new Loader();
loader.load(request);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
addChild(loader);
}
public function onComplete(e:Event):void
{
var b: BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,false,0xDEDEDE);
b.draw(loader);
ba = PNGEncoder.encode(b);
loader.loadBytes(ba);
addChild(loader);
}
}
}