|
|||
|
Hello all!
First post - first problem ... I've coded a dragdrop function, but Flash says that there is no property named "dragdrop". And it doesn't work anyway - so i need your help please ![]() Code:
import SWFKit.*;
Application.dragdrop.enable = true;
Application.dragdrop.onDropFiles = function (files){
for (i = 0; i < files.length; i++) {
trace(files[i]);
}
}
|
|
|||
|
In actionscript you will have to use the "setEventHanlder" method to handle events of swfkit.
Actionscript 2: Code:
import SWFKit.*;
// write an event handler
function as_onDropFiles(files)
{
Dialogs.msgBox(files.toString());
}
var dd = new SWFKit.application.dragdrop;
SWFKit.application.dragdrop.enable = true;
// set the "onDropFiles" event handler
// because the "setEventHandler" method of
// the SWFKit wrapper objects is not static,
// we must construct a new instance before call it
dd.setEventHandler("onDropFiles", as_onDropFiles);
stop();
Code:
import SWFKit.*;
import SWFKit.application.*;
// write an event handler
function as_onDropFiles(files)
{
var dlg = new Dialogs;
dlg.msgBox(files.toString());
Dialogs.Release();
}
// SWFKit wrapper classes for as 3 have no static methods,
// we must construct new instances before we can call methods
var dd = new dragdrop;
dd.enable = true;
dd.setEventHandler("onDropFiles", as_onDropFiles);
stop();
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|