Harish - I figured out the mg.source=items[0].src part. I just needed to change .src to the node name in my XML and it is displaying the proper image. I do need to make some additions to get my Proxy and dropped image sized correctly, but you have helped me past the big hurdle part.
Flex is so different from the Flash IDE. The stuff I used to be able to do via actionscript in combination with assets from the Flash Library (duplicateMovieClip(), attachMovie(), etc.) are taking me awhile to find the proper equivalent technique in Flex. I guess I was kind of hoping to be able to better manipulate Flash swf assets with Flex, but it sounds like I'll need to wait for Flash CS3 (or whatever it will be called) to tighten the link between the products. Again, thanks for the help. Dave --- In [email protected], "tosadavemgr" <[EMAIL PROTECTED]> wrote: > > Hopefully you have time for a couple questions. > General Questions: > Your ImageRenderer.mxml component isn't linked in any way to the > DragandDrop.mxml. Is it being used or am I not understanding something? > I am loading my images from an XML file. To connect up my work with > your example, to get my product images to show up on drop, should I > change the performDrop function - > img.source=items[0].src > The proxy image shows up OK, but the drop image doesn't show. I'm > thinking that I'm not referencing the XML path right. > > In my app, I have an XML that gets pointed to: > private functionbabResultHandler(event:ResultEvent):void{ > myProduct = event.result.products.product; > // Hide the busy cursor > CursorManager.removeBusyCursor(); > } > and my image is the node products.product.thumbnail > > I also wanted to point the proxy and dropped image to > products.product.icon, which is a vector version of the product. So > user would see the photo in the TileList, but then the proxy and > dropped version is actually a swf. > > Hopefully this makes sense. > Here's my XML in case I wasn't describing it well. > <?xml version="1.0" encoding="iso-8859-1"?> > <products> > <product code="KRS1022WC" type="floor" > > <name>Double Bank Work Center</name> > <caption>Double Bank Work Center</caption> > <description>text goes here</description> > <image>images/KRS1022WC.jpg</image> > <thumbnail>images/KRS1022WC_tn.jpg</thumbnail> > <icon>images/KRS1022WC_icon.swf</icon> > </product> > </products> > My XML is loaded via HTTPService into a var myProduct:ArrayCollection, > so I would think it would be releatively easy to swap sources with > your for loop in the init function. > > thanks > Dave > > thanks, > > Dave > > > > > --- In [email protected], "Harish Sivaramakrishnan" > <hsivaramakrishnan@> wrote: > > > > Hi Dave, > > > > Not sure if you have decided against using flex and going back to > Flash 8 :) > > Please go through the following link, I have tried to give a sample > solution > > to the problem you are facing. It may not be exactly your > requirement, but > > it more or less solves your chief issues ie, dragging from List to > canvas > > and dragging a dropped image within the canvas and positioning them. > Please > > do go through it and please dont hesitate to email me if you need > any help > > > > http://flexgeek.wordpress.com/2007/03/15/drag-drop-example/ > > > > Thanks > > Harish > > Flex QE, Adobe India. > > > > On 3/14/07, tosadavemgr <tosadavemgr@> wrote: > > > > > > I have looked through most of the past posts on this site > (especially > > > since Flex 2 was released). Many of the search results on > > > Flexsearch.org are from this board. I tried to list some specific > > > things that I'm trying to learn, such as using Drop and Drag to an > > > item that isn't DnD enabled by default, have the dropped item be > > > re-draggable, etc. Even using the built in Drop Manager, I'd like to > > > see a working sample somewhat similar to my generic needs to see if > > > I'm close (from a best practice standpoint) to doing things the right > > > way. I'm tempted to just re-trench and use Flash 8 for my project, but > > > Flex seems so promising. > > > > > > Dave > > > > > > --- In [email protected] <flexcoders%40yahoogroups.com>, > "Igor > > > Costa" <igorcosta@> wrote: > > > > > > > > Dave. > > > > > > > > Try a little search at www.flexsearch.org or > > > > > > > > > > > http://www.flexsearch.org/index.shtml?cx=017079146949617508304%3Ama9avcq0-ng&q=Drag+and+Drop+Example&sa=Search&cof=FORID%3A9#1135 > > > > > > > > Will help to find lots of them. > > > > > > > > Regards > > > > > > > > Igor Costa > > > > www.igorcosta.org > > > > > > > > > > > > On 3/12/07, tosadavemgr <tosadavemgr@> wrote: > > > > > > > > > > Does anyone have a working example of the following. I have a > > > list of > > > > > products in a tilelist, represented by thumbnail images. The > product > > > > > list is stored in a static XML file accessed via HTTPService. > > > > > My TileList: > > > > > <mx:TileList height="100%" width="190" dataProvider="{myProduct}" > > > > > itemRenderer="thumbnail" columnCount="2" columnWidth="85" > > > > > dragEnabled="true" dragMoveEnabled="false" > > > > > ></mx:TileList> > > > > > > > > > > My itemRenderer: > > > > > <?xml version="1.0"?> > > > > > <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" > > > > > horizontalAlign="center" > > > > > verticalGap="0" borderStyle="none" paddingLeft="0" > > > > > paddingRight="0"> > > > > > <mx:Image id="image" width="82" height="62" > > > > > source="{data.thumbnail}" toolTip="{data.code}"/> > > > > > </mx:VBox> > > > > > > > > > > I need to be able to drag a product from the TileList and make > a COPY > > > > > on a canvas that would also draggable (so after a few items are > > > > > dragged, they could be arranged anywhere on the canvas). Also > in the > > > > > XML is a icon view of the image that is a vector drawing, so I > want to > > > > > use that as the Proxy view while dragging and also as the item > to be > > > > > dropped. It can be accessed as source="{data.icon}". > > > > > > > > > > I have been looking at the samples with the updated Chapter 29 > Using > > > > > Drag and Drop from the Flex Documentation, but I seem to be > making my > > > > > application worse, not generating a workable solution. > > > > > I've also looked at this site - > > > > > http://demo.quietlyscheming.com/DragTile/DragDrop.html - which > has a > > > > > really cool example, but there is so much interactivity going > on with > > > > > the tweening that it is hard to understand the basic drop and drag > > > > > functions. > > > > > > > > > > Any help or a pointer to a good (simple) example would be > appreciated. > > > > > > > > > > Dave > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > ---------------------------- > > > > Igor Costa > > > > www.igorcosta.org > > > > www.igorcosta.com > > > > skype: igorpcosta > > > > > > > > > > > > > > > >

