Reputation: 6898
I have a project in Flash Professional CS5 and ActionScript 3.
I have various objects that I can drag around the screen (tile1-tile5, and drop them on any of five different places (slot1-slot5). This works without the slightest bit of issue. All of this code is placed on the first keyframe for tile1-tile5.
However, I need to use the NativeDragEvent.NATIVE_DRAG_ENTER and NativeDragEvent.NATIVE_DRAG_EXIT. My code is below. It is placed on the first keyframe for slot1 in this example.
slot1.addEventListener(NativeDragEvent.NATIVE_DRAG_OVER, slot1enter);
slot1.addEventListener(NativeDragEvent.NATIVE_DRAG_EXIT, slot1exit);
function slot1enter(evt:NativeDragEvent):void {
trace("Drag entered.");
}
function slot1exit(evt:NativeDragEvent):void{
trace("Drag exit.");
}
What is going on here? How can I get this to work?
Upvotes: 0
Views: 654
Reputation: 6898
There is a confusion here. I'm using the built-in startDrag in Flash to drag an interactive element. However, NativeDragEnter and NativeDragExit only work with OS drags, so this is apples and oranges. One won't work with the other.
Upvotes: 0
Reputation: 15955
NativeDragEvent is only available for AIR runtime.
Assure your Flash Pro publish is targeting the AIR runtime.
Upvotes: 1