3/11/2010 5:50:16 AM
Title:
In flip book add video for drag and drop
In the flipbook we easily add the images for drag and drop.But instead of video at first i put video it doesn't work after that i convert the video to swf and using image tag i drag and drop the swf video it drag and drop and it always shows loading only after that it doesn't show video please send a solution for this i using repeater for display the video i attached the image drag and drop coding with pls help me...
//initiate the drag operation
private function dragIt(event:MouseEvent):void
{
var dragInitiator:Image = event.currentTarget as Image;
var imageProxy:Image = new Image();
imageProxy.source=dragInitiator.source;
imageProxy.height=dragInitiator.height;
imageProxy.width=dragInitiator.width;
var dragSource:DragSource = new DragSource();
dragSource.addData(dragInitiator, 'source');
DragManager.doDrag(dragInitiator, dragSource, event,imageProxy);
}
//enable the drop target to accept the drop object
private function dragEnterHandler(event:DragEvent):void
{
if(ImageView!=null)
{
var dropTarget:FlexBook=event.currentTarget as FlexBook;
DragManager.acceptDragDrop(dropTarget);
}
}
//assigning the droped object to drop target
private var img:Image = new Image();
private function dragDropHandler(event:DragEvent):void
{
img = event.dragSource.dataForFormat('source') as Image;
setTimeout(AssignIamge,300);
}
private function AssignIamge():void
{
if(ImageView.viewRect.left<ImageView.contentMouseX && ImageView.viewRect.top<ImageView.contentMouseY && ImageView.viewRect.right>ImageView.contentMouseX && ImageView.viewRect.bottom>ImageView.contentMouseY)
{
ImageView.imageURL=img.source.toString();
}
}
//enable the drop target to accept the drop object for repeater
private function dragEnterHandlerForRepeater(event:DragEvent):void
{
var dropTarget:Image=event.currentTarget as Image;
DragManager.acceptDragDrop(dropTarget);
}
//assigning the droped obect to drop target for repeater
private function dragDropHandlerForRepeater(event:DragEvent,id:String):void
{
var img:Image = event.dragSource.dataForFormat('source') as Image;
if(id!=img.id)
{
img.source=null;
}
}
3/11/2010 7:19:48 AM
embed the video in your swf timeline file , do not load inside the swf dynamically.
Embeding video inside swf timeline will fix the problem of loading video. Loading this swf as source in image component should work now.