views:

83

answers:

1

We have a Flex 3 application of which the main .swf is running in Firefox. Lets call this application Main.swf.

I'm required to create a secondary .swf, call it Panel.swf which is to be embedded in a separate Firefox popup window, which will be invoked via ExternalInterface calling JavaScript from Main.swf.

Is it possible to link Main.swf and Panel.swf in such a manner that I can enable Drag 'n Drop from Panel.swf to Main.swf?

The idea is for our Main.swf RIA to be run, for example on the users main monitor, and then have the Firefox popup window, containing the separate Panel.swf running on the users other additional monitor if he has one...or at least a separate minimizable window.

Panel.swf for example contains some thumbnail images, and the user can drag 'n drop these images from Panel.swf to Main.swf.

Thanks in advance.

+1  A: 

i'm not sure about drag and drop but you could easily link the two using local connection. a nice helper class can be found here http://www.gskinner.com/blog/archives/2007/07/swfbridge_easie.html

you could have a link appear on rollover in your first movie which 'sends' the image across to your second.

hope that helps,

Josh

Josh
Wow, thanks. If this can do a connection to 2 players in 2 separate browser windows...then this is my answer.
Joe Zephyr
yes you can do a connection to any flash movie playing on the same domain/computer. the only issue is that they need to have a unique id to share. i create one via javascript and pass it in to the movies to use.
Josh
I'm thinking, with the SWFBridge, I might be able to create for example an onDragStart event on the Panel.swf and in that event handler send some parameters to Main.swf like what is being dragged (which might be as simple as the id of the image being dragged) and have Main.swf save these attributes in some variable. Then, on Main.swf, I create an onDragEnd event handler to take a look if any parameters where sent, and then process them likewise. If sent parameters are blank, I simply ignore the onDragEnd.
Joe Zephyr
the only problem is visually you wouldn't see the image between the two movies. not sure if that is a problem or not.
Josh
You could fake the moving / dragging if both SWFs knew about the image.i.e. as you drag out of one movie, start showing the image (or a copy) in another. It is a hack, but you could probably get it to work pretty well.
mikechambers