Open Jpg Image WithOut PHP(FP10)

by heart_thai
♥3 | Line 27 | Modified 2010-03-22 02:53:20 | MIT License
play

ActionScript3 source code

/**
 * Copyright heart_thai ( http://wonderfl.net/user/heart_thai )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/rWsf
 */

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:Script>
		<![CDATA[
		import flash.display.Loader;
		import flash.events.Event;
		import flash.net.FileReference;
		import flash.utils.ByteArray;
		 
		private var f:FileReference;
		private function openFile():void{
			f = new FileReference();
			f.addEventListener(Event.SELECT , loadFile );
			f.addEventListener(Event.COMPLETE , loaded );
			f.browse();
		}
		private function loadFile(e:Event):void {
			f.load();
		}
		private function loaded(e:Event):void{
			var b:ByteArray = f.data;
			img.data = b;
		} 
		]]>
	</mx:Script>
	
	<mx:Image id="img" />
	<mx:Button label="Click" click="openFile()"></mx:Button>
</mx:Application> 

Forked