--- In flexcoders@yahoogroups.com, "David Kramer" <kramer.da...@...> 
wrote:
>
>  Thanks for the reply.  To be very specific...
> 
> I'm trying for any way to achieve this: parentDocument.currentAC 
(in app)
> = presentationsSlidesAC (in component), so the main 
application.mxml has
> the currentAC updated. (Loose, tight, whatever.)
> 
> Here's the DropLabel.mxml component code:  
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml";
> text="{data.pTitle}" 
> dragEnter="draggedInto(event)"
> dragDrop="testDrop(event)"
> click="clickHandler(event)"
> width="220" textAlign="left" color="#ffffff"
> fontSize="12">
> 
> <mx:Metadata>
> [Event('presentationSelected')]
> </mx:Metadata>
> 
> <mx:Script>
> <![CDATA[
> 
> import mx.collections.ArrayCollection;
> 
> import mx.controls.Alert;
> import mx.core.DragSource;
> import mx.managers.DragManager;
> import mx.events.DragEvent;
> 
> //import flash.data.SQLResult;
> //import flash.filesystem.File;
> //import flash.data.SQLStatement;
> //import flash.data.SQLConnection;
> //import flash.events.SQLEvent;
> //import flash.events.SQLErrorEvent;
> 
> private function draggedInto(event:DragEvent):void
> 
> {
> DragManager.acceptDragDrop(this);                    
> }
> 
> 
> private function testDrop(event:DragEvent):void { if
> (event.dragSource.hasFormat("items"))
> 
> 
> {               
> 
> var itemsArray:Array = event.dragSource.dataForFormat("items") as 
Array;
> // breakpoint, examine itemsArray[0]
> 
> //Do sql stuff here, which works fine
> Alert.show(itemsArray[0].sTitle + '\nadded to\n' + this.text);
> 
> }
> 
> 
> }
> 
> [Bindable]
> private var presentationsSlidesAC:ArrayCollection;
> 
> //public var selectedPresentation:Object;
> 
> 
> private function clickHandler(event:MouseEvent):void
> 
> 
> {   
> //Do sql stuff here, works fine (requery via SELECT), the result is 
in an
> arrayCollection called presentationsSlidesAC
> 
> //I'm trying to simply get this assignment.
> //parentDocument.currentAC = presentationsSlidesAC;
> 
> }
> 
> ]]>
> </mx:Script>
> 
> </mx:Label>

I think your problem is actually more like Q 15.  

I'd suggest that when your service result returns that you dispatch 
a "gotData" event or something and then expose a public property that 
the parent application reads when the data is returned.

Or you might want to consider having the application do the retrieval 
instead of the renderer.  I'm not sure how appropriate it is to have 
itemRenderers acting as controllers.

Reply via email to