| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Nov 2007
Posts: 6
|
So ive just really got to grips with AS2 then AS3 kicks me right in the balls!!
Im trying out a Air app where you simply drag and drop a jpg onto the app and it loads the jpg.. its from a flv tut from gotoandlearn.com. the problem im having is i want to drag and drop jpgs from a browser window and have it load. Its weird because the process works in the .swf format but when published in Air it cant pick up the Url/path anymore??? (desktop drag and drops work fine as it can find the path) Heres the code: Code:
import flash.desktop.NativeDragManager;
import flash.events.NativeDragEvent;
import flash.desktop.ClipboardFormats;
var imageLoader:Loader = new Loader();
dropBox.addChild(imageLoader);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, onDragEnter);
this.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, onDragDrop);
function onDragEnter(e:NativeDragEvent):void{
var fa:Object = e.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT);
if(fa[0].extension=="jpg"){
NativeDragManager.acceptDragDrop(this);
}
}
function onDragDrop(e:NativeDragEvent):void{
var fa:Object = e.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT);
imageLoader.load(new URLRequest(fa[0].url));
//trace(fa);
}
what do i need to do to alter: imageLoader.load(new URLRequest(fa[0].url)); to make it get the correct path? or is this simply a security problem/issue? Why does the .swf work but not the Air app? And finally i tried to trace the issue but how can i trace when publishing in Air? Any help would be great. Thanks! |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Security Issue Loading External Files | lloydmav | Components | 18 | 08-19-2008 06:59 AM |
| Adobe AIR Beta 2 has been released today! | CyanBlue | AIR (Apollo) | 7 | 10-05-2007 05:59 PM |
| Flash Security issue with LoadVars | marrek | ActionScript 2.0 | 5 | 03-14-2007 09:16 PM |
| Flash / XML security / access issue... | daveystew | Other Flash General Questions | 0 | 04-08-2006 10:03 AM |
| Security Questions & Issue | TeitanErim | Server-Side Scripting | 3 | 07-14-2005 07:43 PM |