-
1. Re: Type coertion DragEvent issue
Harbs. Jan 10, 2012 7:51 AM (in response to PhotoSì)Don't use the debugger...
Harbs
-
2. Re: Type coertion DragEvent issue
Bob StuckyJan 10, 2012 8:31 AM (in response to PhotoSì)
1 person found this helpfulI assume you're dragging to and from Photoshop from your panel?
I have an extension that does that successfully using Flex 3.4, listening for NativeDragEvent. It's not part of a mx:Window component...
-
3. Re: Type coertion DragEvent issue
PhotoSì Jan 20, 2012 8:02 AM (in response to Bob Stucky)Thank you Bob, it works with NativeDragEvent.
The only problem is that the HorizontalList doesn't show the lines indicator during the drag and drop operation, but i resolved creating by myself. -
4. Re: Type coertion DragEvent issue
nam1490 Feb 29, 2012 1:04 AM (in response to PhotoSì)hi PhotoSi,
How you calculate drop position?
-
5. Re: Type coertion DragEvent issue
PhotoSì Feb 29, 2012 1:23 AM (in response to nam1490)Actually all items on our list have an attribute "position" (handle by our methods). When the drop event is catch i can get the item where the drop is engaged....and then our attribute about the position.
did it help you?
-
6. Re: Type coertion DragEvent issue
nam1490 Feb 29, 2012 2:04 AM (in response to PhotoSì)how you got the item from list through nativeEvent?Actually i have used AdvancedDataGrid and i want drop position or item at drop position?
-
7. Re: Type coertion DragEvent issue
PhotoSì Feb 29, 2012 2:18 AM (in response to nam1490)simply every item on the list has a eventHandler: nativeDragDrop="dragDropHandler...(event, data.Position)" where data.Position is the Position of the element (we user indexOf(this) on the horizzontal list to get the right position).
We don't use DataGrid so i cannot help on that........
-
8. Re: Type coertion DragEvent issue
charanseeram Jun 27, 2012 7:42 AM (in response to PhotoSì)*** Security Sandbox Violation ***
SecurityDomain 'http://portip:8080/MyProject//servlet/ThumbDownloadServlet?fileName=179924 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\projects\framework\src \mx\core\UIComponent.as:9408]
at mx.managers::NativeDragManagerImpl/_dispatchDragEvent()[C:\autobuild\galaga\frameworks\pr ojects\airframework\src\mx\managers\NativeDragManagerImpl.as:625]
at mx.managers::NativeDragManagerImpl/nativeDragEventHandler()[C:\autobuild\galaga\framework s\projects\airframework\src\mx\managers\NativeDragManagerImpl.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,onDragComplete);
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;
}
}