I'm trying to use flash8 to create an drag and drop event using the mouse.
My code is:
import flash.events.MouseEvent;
circle_mc.addEventListener(MouseEvent.MOUSE_DOWN,downf);
circle_mc.addEventListener(MouseEvent.MOUSE_UP,upf);
function downf(e:MouseEvent) { circle_mc.startDrag(); }
function upf(e:MouseEvent) { circle_mc.stopDrag(); }
I get these errors:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: Statement must appear within on/onClipEvent handler
circle_mc.addEventListener(MouseEvent.MOUSE_DOWN,downf);
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 4: Statement must appear within on/onClipEvent handler
circle_mc.addEventListener(MouseEvent.MOUSE_UP,upf);
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 5: The class or interface 'MouseEvent' could not be loaded.
function downf(e:MouseEvent) {
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: The class or interface 'MouseEvent' could not be loaded.
function upf(e:MouseEvent) { circle_mc.stopDrag(); }
Total ActionScript Errors: 4 Reported Errors: 4
I don't understand why this is happening. On Internet I've found that this error may be caused due to the version of AS3 or AS2, but I also can't find the version I use.
Any help is appreciated.