If the SWFLoader is the droptarget, it can be taught to call some
function in your movieclip to tell it what color got dropped on it.
Then you can use any kind of communication you want between the
SWFLoader and the MovieClip w/o having to convert each MovieClip to
UIMovieClip

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Rich Germuska
Sent: Friday, December 14, 2007 11:15 AM
To: [email protected]
Subject: [flexcoders] Re: How to use DragManager.acceptDragDrop() when
target is a MovieClip?

 

Hi Alex, 

I'm getting the MovieClips into Flex using a custom subclass of 
SWFloader. And then reaching inside the SWF using helper functions 
embedded in the SWF.

I actually need every MovieClip to respond to DragEvents - because 
together the MovieClips form a complex piece of artwork (originally 
handrawn, then livetraced in AI CS3, and then import wizard to Flash 
CS3, then jsfl'd to give each on an instance name, and now trying to 
get SWF into Flex...). 

I want to be able to change the color of each MovieClip using drag 
and drop.

I can't see how making the SWFLoader the dropTarget will allow me to 
do this?

Thanks for your ongoing help! Rich

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Those movieclips will have a parent. Do they all have the same 
parent?
> For example, sometimes, someone uses something like mx:Image to 
show an
> image based on some selection. If that mx:Image was the drop 
target,
> then the internal widgets don't have to be.
> 
> 
> 
> There is a 2.0.1 kit. I'm not sure where it lives now.
> 
> 
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>

[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of quiet.mountain
> Sent: Friday, December 14, 2007 3:27 AM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: How to use DragManager.acceptDragDrop() 
when
> target is a MovieClip?
> 
> 
> 
> Sorry no savvy. Can you elaborate... Why do I not need to convert 
> all 90,000 MovieClips to UIMovieClips?
> 
> Also how do I get UIMovieClip into Flex 2.01?
> 
> var dropTarget:UIMovieClip = UIMovieClip(event.currentTarget);
> 
> This line won't compile...
> 
> --- In [email protected]
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > I would think you might want to convert a container for your 
> movieclips
> > to accept the drop.
> > 
> > 
> > 
> > ________________________________
> > 
> > From: [email protected]
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:[email protected]
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of quiet.mountain
> > Sent: Thursday, December 13, 2007 12:44 PM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Re: How to use DragManager.acceptDragDrop() 
> when
> > target is a MovieClip?
> > 
> > 
> > 
> > OK I'm now using the integration kit so the movieclips are fixed 
> > manually for now in the fla.
> > 
> > (I actually need to convert over 90,000 movieclips in abut 
> 400 .fla 
> > files to UIMoveiClips - but I'm hoping I can hack the "Make Flex 
> > Component" jsfl? But that's probably another posting.) 
> > 
> > Anyway assuming I convert from MovieClip to UIMovieClip manually 
> for 
> > now, I'm still not home and dry because I don't have 
> > mx.flash.UIMovieClip in Flex 2.01, so I can't specify the event 
> > handler in Flex for the dropTarget i.e.
> > 
> > var dropTarget:UIMovieClip = UIMovieClip(event.currentTarget);
> > 
> > How do I get UIMovieClip into the Flex 2.01 SDK? Can I just copy 
> and 
> > paste mx.flash.UIMovieClip from the Flex 3 beta SDK into the Flex 
> > 2.01 SDK ? Sorry if that's a really dumb question.
> > 
> > Cheers, Rich
> > 
> > >
> > > Use the integration kit or implement IUIComponent on your own.
> > > 
> > > 
> > > 
> > > ________________________________
> > > 
> > > From: [email protected]
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> 40yahoogroups.com>
> > 
> > [mailto:[email protected]
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> 40yahoogroups.com>
> > ] On
> > > Behalf Of quiet.mountain
> > > Sent: Thursday, December 13, 2007 12:18 AM
> > > To: [email protected]
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> <mailto:flexcoders%
> 40yahoogroups.com> 
> > > Subject: [flexcoders] Re: How to use DragManager.acceptDragDrop
> () 
> > when
> > > target is a MovieClip?
> > > 
> > > 
> > > 
> > > Sorry,
> > > 
> > > I should have mentioned that my MovieClips are being created in 
> > Flash 
> > > CS3 and I am not currently using the Adobe Flash Workflow 
> > Integration 
> > > Kit.
> > > 
> > > So I am talking about using the DragManager with 
> > > flash.display.MovieClip.
> > > 
> > > The suggested solution for Flex 3 is to use UIMovieClip:
> > > 
> > 
> 
http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.ht
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.ht> 
> 
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.ht
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.ht> 
> 
> m
> > 
> 
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h> 
> 
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h> >

> tm>
> > 
> > > 
> > 
> 
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h> 
> 
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h> >

> t
> > 
> 
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h> 
> 
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h
<http://livedocs.adobe.com/labs/flex/3/langref/mx/flash/UIMovieClip.h> >

> t> 
> > m>
> > > 
> > > l
> > > 
> > > I have two questions:
> > > 
> > > 1) Will this work with Flex 2.01?
> > > 2) If I publish the FLA as a SWF will the MovieClips be of type 
> > > UIMovieClip (I don't want to use SWCs)?
> > > 
> > > Many thanks, Rich
> > > 
> > > --- In [email protected]
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> > 40yahoogroups.com>
> > > , "quiet.mountain" 
> > > <quiet.mountain@> wrote:
> > > >
> > > > Evening all,
> > > > 
> > > > Simple one here I hope..
> > > > 
> > > > I have a bunch of Movieclips that I want to color in using 
> drag 
> > and 
> > > > drop of little colored tiles from a TileList.
> > > > 
> > > > The MovieClips obviously do not implement IUIcomponent, so 
how 
> do 
> > I 
> > > > use DragManager.acceptDragDrop(target:IUIComponent) to accept 
> the 
> > > > drag once over the MovieClip?
> > > > 
> > > > Here's my code:
> > > > 
> > > > /*
> > > > * Function to handle dragEnter over MovieClip rug shape
> > > > */
> > > > public function dragEnterHandler(event:DragEvent): void
> > > > { 
> > > > // Get the drop target component from the event object
> > > > var dropTarget:MovieClip = MovieClip(event.currentTarget);
> > > > 
> > > > // Accept the drag only if the user is dragging data 
> > > > // identified by the 'items' format value.
> > > > if (event.dragSource.hasFormat('items')) 
> > > > {
> > > > DragManager.acceptDragDrop(dropTarget);
> > > > }
> > > > }
> > > > 
> > > > 
> > > > As ever, many thanks for your time,
> > > > Rich
> > > >
> > >
> >
>

 

Reply via email to