1 Reply Latest reply on Jun 3, 2010 10:53 AM by cyber0897

    multiple popupAnchors dont work in one application?

    cyber0897 Level 1

      hey guys... so im trying to create an application, in which when you click a button a datagrid popups up using a popupAnchor

       

      and after, when i click on a item in that datagrid, i need another popup anchor to popup above the datagrid....

       

      hope im making sence...

       

      any ideas on how to do this???

       

      if you would like you can put the following code in flash builder and check out what its doing right now... i have the datagrid popping up, i just cannot get the details panel to popup above the datagrid

       

      thanks in advance!!

       

       

           <fx:Declarations>
                <mx:Sequence id="panelOut">
                     <s:Scale target="{uploadPanel.popUp}" scaleYFrom=".1" scaleYTo="1" duration="500" effectEnd="btn.label='Close'" />
                </mx:Sequence>
                <mx:Sequence id="panelIn">
                     <s:Scale target="{uploadPanel.popUp}" scaleYFrom="1" scaleYTo=".1" duration="400" effectEnd="btn.label='Image Uploader';uploadPanel.displayPopUp = false;"/>
                </mx:Sequence>
                
                <s:Sequence id="detailsPanelOut">
                     <s:Scale target="{detailsPanel.popUp}" scaleXFrom=".1" scaleXTo="1" duration="500" />
                </s:Sequence>
                <s:Sequence id="detailsPanelIn">
                     <s:Scale target="{detailsPanel.popUp}" scaleXFrom="1" scaleXTo=".1" duration="400" />
                </s:Sequence>
                
           </fx:Declarations>
           <fx:Script source="imageEditorScript.as" />
           <fx:Script>
                <![CDATA[
                     import mx.controls.Alert;
                     import mx.effects.easing.*;
                     
                     private function toggleBtn(e:MouseEvent):void{
                          if(e.currentTarget.label== 'Image Uploader'){
                               panelOut.play();
                               uploadPanel.displayPopUp = true;
                          }
                          else{
                               panelIn.play();
                          }
                     }
                     
                     private function itmClicked():void{
                          panelOut.play();
                          detailsPanel.displayPopUp = true;
                     }
                ]]>
           </fx:Script>
           
           <s:Group width="100%" height="100%">
                <mx:HRule width="100%" />
                <s:Group top="10" width="100%" height="500">
                     <mx:LinkButton width="100%" height="21" label="Image Uploader" color="#333333" click="toggleBtn(event);" />
                     <s:PopUpAnchor id="uploadPanel" popUpPosition="below">
                          <s:VGroup id="imageUploader" height="440" width="795" contentBackgroundColor="#ffffff">
                               <mx:DataGrid id="displayFilesList" allowMultipleSelection="true" height="440" width="100%" borderColor="#ffffff" contentBackgroundColor="#e9e9e9"
                                               horizontalGridLineColor="#e9e9e9" verticalGridLines="false" verticalGridLineColor="#e9e9e9" dataProvider="{fileNames}"
                                               alternatingItemColors="{[]}" resizableColumns="true" draggableColumns="false" itemClick="itmClicked();">
                                    <mx:columns>
                                         <mx:DataGridColumn headerText="#" dataField="num" width="30" />
                                         <mx:DataGridColumn headerText="File" dataField="name" width="400"/>
                                         <mx:DataGridColumn headerText="Size" dataField="size" width="75" textAlign="right" />
                                         <mx:DataGridColumn headerText="Status" dataField="status" width="125">
                                              <mx:itemRenderer>
                                                   <fx:Component>
                                                        <components:statusBar />
                                                   </fx:Component>
                                              </mx:itemRenderer>
                                         </mx:DataGridColumn>
                                    </mx:columns>
                               </mx:DataGrid>
                               <s:HGroup>
                                    <s:Button id="addingImage" label="ADD" click="initiateBrowse();" />
                                    <s:Button id="deleteImage" label="DEL" />
                                    <mx:ProgressBar id="progBar" mode="manual" labelPlacement="center" width="300" />
                               </s:HGroup>
                               <mx:LinkButton id="btn" width="100%" height="21" label="Image Uploader" color="#333333" click="toggleBtn(event);" />
                          </s:VGroup>
                     </s:PopUpAnchor>
                </s:Group>
                <s:Group>
                     <s:PopUpAnchor id="detailsPanel" popUpPosition="left">
                          <s:VGroup width="100%" height="1000" contentBackgroundColor="blue" >
                               
                          </s:VGroup>
                     </s:PopUpAnchor>
                </s:Group>
                <s:VGroup width="100%" height="100%" top="30">
                     <s:HGroup paddingTop="20">
                          <s:Label text="Look For" />
                          <s:TextInput id="searchField" width="300" />
                          <s:Button label="Search" id="searchBtn" />
                     </s:HGroup>
                     <s:BorderContainer width="100%" height="100%">
                          <mx:TileList id="searchResultImages" borderVisible="false"
                                          columnWidth="135" rowHeight="135" width="100%" height="100%" >
                          </mx:TileList>
                     </s:BorderContainer>
                </s:VGroup>
           </s:Group>