3 Replies Latest reply on Jul 21, 2011 2:46 PM by drkstr_1

    Can you move an object in a spark panel?

    broconne

      I have an empty spark panel that I add two object to.  After I add them, I want to perform a move operation to split them apart over a duration.  It seems that my move operation has no effect.

       

      My panel declration is as follows:

      <s:Panel id="nodeExplorer" backgroundColor="0xFFFFFF" creationComplete="hidePanelHeader(event)"  height="100%">
                <s:layout>
                     <s:VerticalLayout>
                          <s:verticalAlign>middle</s:verticalAlign>     
                          <s:gap>0</s:gap>
                     </s:VerticalLayout>     
                </s:layout>
                <s:Group id="explorerGroup">
                     
                </s:Group>
           </s:Panel>
      

       

       

      My add and move function look like the following:

       

      public function exploreNode(image:Image):void {
           image.parent.removeChild(image);                                                       
                                         
           var topImage:BitmapImage = new BitmapImage();
           topImage.source=(new P7TopImage() as Bitmap).bitmapData;
                          
           var bottomImage:BitmapImage = new BitmapImage();
           bottomImage.source=(new P7BottomImage() as Bitmap).bitmapData;
                          
      
           nodeExplorer.addElement(topImage);
           nodeExplorer.addElement(bottomImage);
                                              
                                         
           var parallelMove:Parallel = new Parallel();                         
           var topMove:Move = new Move(topImage);
           topMove.yBy=-50;                         
           var bottomMove:Move = new Move(bottomImage);
           bottomMove.yBy=50;                    
                               
           parallelMove.children = [topMove,bottomMove];
           parallelMove.duration = 4000;
                               
           parallelMove.play();                         
                                                                                                                                                                                
      }
      
      
      
      

       

       

      Any idea on how I can make those images move?