Permalink
Browse files

first commit

  • Loading branch information...
root
root committed Nov 11, 2009
1 parent 5dae584 commit f414a003f8e4710f8ab3470fca37efb2bfcc79f9
View
0 README
No changes.
View
Binary file not shown.
View
@@ -59,7 +59,7 @@
}
private function fileLoaded(event : Event):void{
- new ThumbnailGenerator(event.currentTarget, ApplicationVars.DEFAULT_THUMB_WIDTH, ApplicationVars.DEFAULT_THUMB_HEIGHT, handleDroppedFile, ApplicationVars.folderToSave);
+ new ThumbnailGenerator(event.currentTarget, ApplicationVars.DEFAULT_THUMB_WIDTH, ApplicationVars.DEFAULT_THUMB_HEIGHT, handleDroppedFile);
}
protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
@@ -133,13 +133,10 @@
</s:HGroup>
<s:nativeDragEnter>
- // Event handler for when something is dragged over to the WindowedApplication
-
- // Only allow files to be dragged in
if (event.clipboard.hasFormat(ClipboardFormats.FILE_LIST_FORMAT))
{
- var files:Array = event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;
- DragManager.acceptDragDrop(event.currentTarget as WindowedApplication);
+ var files:Array = event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;
+ DragManager.acceptDragDrop(event.currentTarget as WindowedApplication);
}
</s:nativeDragEnter>
@@ -49,7 +49,7 @@ package cc.vamel.utils
public var saveToFolder : File = null;
//the callback function need a object as parameters
- public function ThumbnailGenerator(loader : Object, width:int, height:int, $callBackFunction : Function = null, saveToFolder : File = null)
+ public function ThumbnailGenerator(loader : Object, width:int, height:int, $callBackFunction : Function = null)
{
this.saveToFolder = saveToFolder;
@@ -110,43 +110,42 @@ package cc.vamel.utils
stream.open( outputFile, FileMode.WRITE );
stream.writeBytes( compressedByteArray, 0, 0 );
- stream.close();
-
+ stream.close();
creationComplete();
+
}
private function creationComplete():void{
createdFilesIndex++;
if(callBackFunction){
callBackFunction(outputFile);
- clearAllObjects();
}
else{
- trace('`Files created but no callback function was created');
- clearAllObjects();
+ trace('Files created but no callback function was created');
}
+ clearAllObjects();
+
}
- //this function clear all objects and invoke the garbage collector of flash
- private function clearAllObjects():void{
-
+ //this function clear all objects and invoke the garbage collector
+ private function clearAllObjects():void{
outputFile = null;
- byteArrayFromOriginalFile = null;
- jpegEncoder = null;
- _loader = null;
- bmp = null;
- bmpd =null;
- encoder = null;
- img = null;
- matrix = null;
- ratio = null;
- outputHeight = null;
- outputWidth = null;
- outputByteArray = null;
+ byteArrayFromOriginalFile = null;
+ jpegEncoder = null;
+ _loader = null;
+ bmp = null;
+ bmpd =null;
+ encoder = null;
+ img = null;
+ matrix = null;
+ ratio = null;
+ outputHeight = null;
+ outputWidth = null;
+ outputByteArray = null;
- System.gc();
+ System.gc();
}
}

0 comments on commit f414a00

Please sign in to comment.