I believe that you need to dispatch an event from the PopUp with all
of the information that you want to pass to the main Application. Here
is an example of what I think you want to do:

FILE: heightEvent .as
package
{
    import flash.events.Event;
    
    public class heightEvent extends flash.events.Event
    {

        public var heightProperty : int;
       
        public function heightEvent(_heightProperty:int)
        {
            super("changeHeight");
            heightProperty = _heightProperty;
        }

    }
}

FILE: MyTitleWindow.mxml
<?xml version="1.0"?>

<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml";
title="Details" showCloseButton="true" close="closeDialog();">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.controls.Alert;

public var slotHeight:Number;

public function closeDialog():void {
var sizeNum:Number = 0;
sizeNum = slotSize.value * 2.5;
slotHeight = sizeNum;
dispatchEvent(new heightEvent(slotHeight));

PopUpManager.removePopUp(this);
}

]]>
</mx:Script>

<mx:Label text="Size"/>
<mx:NumericStepper id="slotSize" maximum="1440" minimum="10"/>
<mx:Button label="Done" click="closeDialog()"/>

</mx:TitleWindow>

FILE: test.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="initApp()">

<mx:Script>
<![CDATA[
import mx.controls.TileList;
import mx.controls.Button;
import mx.controls.Alert;
import mx.events.DragEvent;
import mx.controls.List;
import mx.managers.DragManager;
import mx.core.DragSource;
import mx.managers.PopUpManager;
import mx.core.IFlexDisplayObject;
import heightEvent;

public var w:IFlexDisplayObject;

private function initApp():void {
var dp:Array = ([
{label:"First", data:"25"},
{label:"Second", data:"50"},
]);
listOne.dataProvider = dp;
box001A.dataProvider = [];

}

public function slotDetails(slot:TileList):void {
var w:MyTitleWindow = MyTitleWindow
(PopUpManager.createPopUp
(this, MyTitleWindow, true));
w.addEventListener("changeHeight", changeHeightHandler);

w.height=200;
w.width=340;
w.slotHeight = slot.height;
PopUpManager.centerPopUp(w);
}

public function changeHeightHandler(event:heightEvent)
{
    box001A.height = event.heightProperty;
}

]]>
</mx:Script>

<mx:List id="listOne" dragEnabled="true"
dropEnabled="false" x="10" y="10"></mx:List>
<mx:TileList x="10" y="172" dropEnabled="true"
dragMoveEnabled="true" dragDrop="slotDetails(box001A)"
dragEnabled="true" id="box001A" rowCount="1" columnCount="1"
height="25" width="162">

</mx:TileList>
<mx:Text x="10" y="289" text="{box001A.height}"
width="82"/>


</mx:Application>


I hope this helps.
Joan 

--- In flexcoders@yahoogroups.com, "jmfillman" <[EMAIL PROTECTED]> wrote:
>
> I've attempted to model this after an Adobe example found here: 
> 
> http://livedocs.adobe.com/flex/201/html/textcontrols_060_19.html
> 
> I'm trying to take that example and apply it to set the height of a 
> control, based on logic in the TitleWindow popup. When you close the 
> TitleWindow, I want the height value of the List to be updated.
> 
> FILE: test.mxml:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
> layout="absolute" creationComplete="initApp()">
> 
> <mx:Script>
>       <![CDATA[
>               import mx.controls.TileList;
>               import mx.controls.Button;
>               import mx.controls.Alert;
>         import mx.events.DragEvent;
>         import mx.controls.List;
>         import mx.managers.DragManager;
>         import mx.core.DragSource;            
>         import mx.managers.PopUpManager;
>         import mx.core.IFlexDisplayObject;
> 
>         public var w:IFlexDisplayObject;        
>         
>               private function initApp():void {
>                       var dp:Array = ([
>               {label:"First", data:"25"},
>                 {label:"Second", data:"50"},
>                 ]);
>             listOne.dataProvider = dp;
>             box001A.dataProvider = [];
>             }
> 
>               public function slotDetails(slot:TileList):void {
>              var w:MyTitleWindow = MyTitleWindow
> (PopUpManager.createPopUp
>                   (this, MyTitleWindow, true));
>                  w.height=200;
>              w.width=340;
>              w.slotHeight = slot.height;
>              PopUpManager.centerPopUp(w);
>         }            
>         
>       ]]>
> </mx:Script>
> 
>               <mx:List id="listOne" dragEnabled="true" 
> dropEnabled="false" x="10" y="10"></mx:List>
>               <mx:TileList x="10" y="172" dropEnabled="true" 
> dragMoveEnabled="true" dragDrop="slotDetails(box001A)" 
> dragEnabled="true" id="box001A" rowCount="1" columnCount="1" 
> height="25" width="162">
>               
>               </mx:TileList>
>               <mx:Text x="10" y="289" text="{box001A.height}" 
> width="82"/>
>               
>       
> </mx:Application>
> 
> 
> 
> FILE: MyTitleWindow.mxml
> 
> <?xml version="1.0"?>
> 
> <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"; 
> title="Details" showCloseButton="true" close="closeDialog();">
>     <mx:Script>
>         <![CDATA[
>             import mx.managers.PopUpManager;
>                       import mx.controls.Alert;            
>             
>             public var slotHeight:Number;
> 
>              public function closeDialog():void {
>               var sizeNum:Number = 0;
>               sizeNum = slotSize.value * 2.5;
>               slotHeight = sizeNum;
>                 PopUpManager.removePopUp(this);
>             }
>             
>         ]]>
>     </mx:Script>
> 
>     <mx:Label text="Size"/>
>     <mx:NumericStepper id="slotSize" maximum="1440" minimum="10"/>
>     <mx:Button label="Done" click="closeDialog()"/>
>         
> </mx:TitleWindow>
>


Reply via email to