Is it *dedication* or would a better word be *sick* that I wrote an InsideRIA article here in my hotel room during a family vacation in Florida? Anyway, for those of you interested, you can read it here:
A student of mine decided to use Doug McCune’s CoverFlowContainer component in his class project. He also wanted to enable drag/drop from one CoverFlowContainer to the next so I took what he had and added some Drag/Drop to it.
There were a couple things he needed supported in the drag/drop:
Drag image data from one coverflow component to a child array container in another coverflow component
Show the original image as the drag image
Only allow dragging into the proper coverflow in other words don’t allow dragging an image into a coverflow using image data children…only one using crate data children.
So…there were a couple things that weren’t quite too fun to work with:
The immediate child of the CoverFlowContainer was a Repeater, getting everything to play nicely without being too kludgy required a custom component and a custom event.
When trying to create an Image clone by just setting the source attribute, it wouldn’t be rendered in the drag image. Found a post discussing how to work around it by using the BitmapData and BitmapAsset classes. (Unfortunately, I can’t find the post in my delicious anymore…will update this if I do)
The DragManager.doDrag() requires a MouseEvent as it’s third parameter…amazingly casting a MouseEvent subclass silently breaks it. So I just added the source MouseEvent as a parameter to my subclass.
I know the code probably isn’t optimal, and if you know a better way to do things feel free to comment on my blog. However, being that it was a pain I figured I’d make the sample available for anyone feeling like taking a peek.
Anyway, below is a sample of the running app…view source is enabled. Also, if you want to download the Flex Builder 3 Project Archive file, here’s the link: