We are developing a new plugin for Photoshop, and we use the <mx:Window....> class to open a new modal window.
Using this approach we always get problems when we try to use DragNDrop event on components like HorizontalList.
Actually the main problem is concerning different version of the class DragEvent:
TypeError: Error #1034: Type Coercion failed: cannot convert mx.events::DragEvent@15fe9581 to mx.events.DragEvent.
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.4.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9408]
at mx.managers::NativeDragManagerImpl/_dispatchDragEvent()[C:\autobuild\galaga\frameworks\projects\airframework\src\mx\managers\NativeDragManagerImpl.as:625]
at mx.managers::NativeDragManagerImpl/nativeDragEventHandler()[C:\autobuild\galaga\frameworks\projects\airframework\src\mx\managers\NativeDragManagerImpl.as:598]
Now we have found a solution using compiler option:
-includes=mx.managers.systemClasses.MarshallingSupport
but we use CS Extension Builder based on Flex SDK 3.4 so it's not possible to use that option.
Do you have any advise to fix that problem?
Thanks
Marco
*** Security Sandbox Violation ***
SecurityDomain 'http://portip:8080/MyProject//servlet/ThumbDownloadServlet?fileName=17 9924 copy.tif&sessionId=NrzEsU-sPKY2ABZCGQ03CQ__.node1&assetId=385344&type =thumb' tried to access incompatible context 'app:/StageManager-2.5.swf'
TypeError: Error #1034: Type Coercion failed: cannot convert mx.events::DragEvent@1a4776d1 to mx.events.DragEvent.
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.4.0\frameworks\pr ojects\framework\src\mx\core\UIComponent.as:9408]
at mx.managers::NativeDragManagerImpl/_dispatchDragEvent()[C:\autobuild\ galaga\frameworks\projects\airframework\src\mx\managers\NativeDragMana gerImpl.as:625]
at mx.managers::NativeDragManagerImpl/nativeDragEventHandler()[C:\autobu ild\galaga\frameworks\projects\airframework\src\mx\managers\NativeDrag ManagerImpl.as:598]
TypeError: Error #1034: Type Coercion failed: cannot convert mx.events::DragEvent@1a477661 to mx.events.DragEvent.
Hi , i am even facing same problem, time being i manged with: myList.addEventListener(NativeDragEvent.NATIVE_DRAG_COMPLETE,onDragCom plete);
But am looking for some parmanet solution for doDrop , some one help me understanding why this :myList.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP,onDrop); is not firing ..
public function imageDrop( event: NativeDragEvent ): void {
trace( "Drop image target is: " + event.currentTarget.toString() );
if ( event.clipboard.hasFormat( ClipboardFormats.FILE_LIST_FORMAT )||
event.clipboard.hasFormat(ClipboardFormats.TEXT_FORMAT) ||
event.clipboard.hasFormat(ClipboardFormats.URL_FORMAT)) {
var fileList: Array = event.clipboard.getData( ClipboardFormats.FILE_LIST_FORMAT ) as Array;
trace( "File List: " + fileList.toString() );
if ( fileList.length > 0 ) {
var f: DragFile = new DragFile( fileList[ 0 ] as flash.filesystem.File );
if ( "jpgjpegpnggif".indexOf( f.extension.toLowerCase() ) > -1 ) {
trace( "Loading file: " + f.nativePath );
loadFile( f );
return;
}
trace( "file is not an image" );
} else {
trace ( "fileList is empty" );
}
}
if ( event.clipboard.hasFormat( ClipboardFormats.BITMAP_FORMAT ) ) {
trace( "Dropping the bitmap" );
var bitmapData: BitmapData = event.clipboard.getData( ClipboardFormats.BITMAP_FORMAT ) as BitmapData;
var bitMap: Bitmap = new Bitmap( bitmapData );
model.imageCollection.addItem( bitMap );
model.selectedIndex = model.imageCollection.length - 1;
}
}
North America
Europe, Middle East and Africa
Asia Pacific