| Previous | Next |
Drag and Drop Files
This sample shows how to enable your application to accept and handle drag-and-drop files using the mWindow.onDragFiles() and mWindow.onDropFiles() event handlers, respectively.
mWindow.onDragFiles() provides a list of files dragged onto the application. Code in this event handler can test the extension of each file. If an extension type matches a file type that the application accepts, the handler returns true.
mWindow.onDragFiles = function(files) {
var extension:String;
var okToDropThisFile:Boolean = false;
for (var i = 0; i<files.length; i++) {
if (!mFile.isFolder(files[i])) { // do not accept folders
extension = getFileExtension(files[i]);
if (extension == "swf") {
okToDropThisFile = true;
}
}
}
return okToDropThisFile;
};
mWindow.onDropFiles() provides an array of files dropped on the application and opportunity to take action on the drop event
You can download this sample, "dragAndDrop", from the mProjector Samples page -- /software/flash-projector/flas.html#dragAndDrop.
| Questions or Feedback? | Previous | Next |
More Information
Getting Started
ActionScript 3.0 Support
- AS2 Migration
- Getting Started - Flash
- Debugging in Flash
- Building your application from inside Flash
- Getting Started - Flex
- Debugging in Flex
ActionScript 3.0 Samples
Using mProjector
- Using mProjector - Compile Your SWF into an Appli
- Customizing The About Window
- Debugging Your Application
- Launching Application at Startup
- Mac vs. Windows Application Development
- Menus
- Dynamic Window Creation
ActionScript 2.0 Samples
- Application Basics
- mProjector Class Basics
- Add Remove Programs Control Panel
- Fullscreen and Center
- Check Connection and Download File
- Choose Files
- Creating an Installer
- Creating and Controlling Multiple Windows
- Cut, Copy, and Paste (Windows)
- Desktop Shortcut and Start Menu Support
- Drag and Drop Files
- Embedding HTML and other Media types
- Flash-Shaped Windows
- Message Box
- Open Documents
- Project Files
- Reading and Writing to Hard Drive
- Startup Application
- Wallpaper and Screensaver
- Window to Window Communications
- Working with Included Files
- Context Sensitive Menus
- Alert User
- Screen Resolution
