WIN, IE, FlashPlayer 10,0,45,2 debug のバグ
♥1 |
Line 48 |
Modified 2010-04-16 11:40:23 |
MIT License
archived:2017-03-09 11:53:07
ActionScript3 source code
/**
* Copyright matsu ( http://wonderfl.net/user/matsu )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/mwiy
*/
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="app();">
<mx:Script>
<![CDATA[
import flash.display.Loader;
import flash.display.Bitmap;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.FileReference;
private function app():void
{
var _fr:FileReference = new FileReference();
browseButton.addEventListener(MouseEvent.CLICK,onClick);
_fr.addEventListener(Event.SELECT,onSelect);
_fr.addEventListener(Event.COMPLETE,onComplete);
function onClick(e:Event):void{
_fr.browse();
}
function onSelect(e:Event):void{
var f:FileReference = FileReference(e.target);
f.load();
}
function onComplete(e:Event):void{
var f:FileReference = FileReference(e.target);
var loader:Loader = new Loader();
loader.loadBytes(f.data);
loader.contentLoaderInfo.addEventListener(Event.INIT,init);
}
//Add the image at the stage center
function init(e:Event):void{
trace(e.target.content);//[object Bitmap]
var bmp:Bitmap = Bitmap(e.target.content);
testImage.addChild(bmp);
textText.text = "3. もう一度、日本語入力してみてください。\nなぜか日本語入力ができない。"
textText.setStyle("color", "#ff0000");
textText.setStyle("fontSize", "20");
}
}
]]>
</mx:Script>
<mx:Box direction="vertical">
<mx:Label text="WIN, IE, FlashPlayer 10,0,45,2 のバグ?" fontSize="16"/>
<mx:Text id="textText" text="1. 日本語入力してみてください。"/>
<mx:TextInput id="testInput"/>
<mx:Label text="2. 次にブラウズでローカルにある画像を画面にロードします。"/>
<mx:Button id="browseButton"/>
<mx:Image id="testImage"/>
</mx:Box>
</mx:Application>