This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var uploadmanager:UploadManager = UploadManager.Instance; | |
// init | |
initUploaderManager(); | |
private function initUploaderManager():void | |
{ | |
// init uploadmanager | |
// set file filter | |
uploadmanager.ApplyFileFilters([new FileFilter("Images (*.jpg, *.jpeg, *.JPG, *.JPEG, *.png, *.PNG)", "*.jpg;*.jpeg;*.JPG;*.JPEG;*.png;*.PNG")]); | |
uploadmanager.onFileLoaded.add(myPhotoLoaded); | |
} | |
private function myPhotoLoaded(__loader:Loader):void | |
{ | |
while(pic_loader.numChildren){ | |
pic_loader.removeChildAt(0); | |
} | |
pic_loader.addChild(__loader); | |
// fits a DisplayObject into a rectangular area | |
var area:Rectangle = new Rectangle( 0, 0, 125, 125 ); | |
DisplayUtils.fitIntoRect( __loader, area, true, Alignment.MIDDLE ); | |
Bitmap(__loader.content).smoothing = true; | |
} | |
// set mouse click | |
btn_browse.addEventListener(MouseEvent.CLICK, function(e:MouseEvent){uploadmanager.Browse();}); |
沒有留言:
張貼留言