0 Replies Latest reply on Mar 24, 2010 3:39 AM by yehuda1233456

    Switching images dynamiccaly with relative layout

    yehuda1233456

         i have this flex code with 4 images:

       

       

      <mx:HBox width="100%" horizontalAlign="right" paddingRight="20" >
                      <mx:VBox paddingLeft="10" >
                          <mx:Image buttonMode="true" source="images/item1.png" id="item1" mouseOver="itemOver(event)" mouseOut="itemOut(event)" completeEffect="Fade"></mx:Image>               
                      </mx:VBox>   
                      <mx:VBox paddingLeft="10" >
                          <mx:Image buttonMode="true" source="images/item2.png" id="item2" mouseOver="itemOver(event)" mouseOut="itemOut(event)" completeEffect="Fade"></mx:Image>
                      </mx:VBox>
                      <mx:VBox paddingLeft="10" >
                          <mx:Image buttonMode="true" source="images/item3.png" id="item3" mouseOver="itemOver(event)" mouseOut="itemOut(event)" completeEffect="Fade"></mx:Image>
                      </mx:VBox>
                      <mx:VBox paddingLeft="10">
                          <mx:Image buttonMode="true" source="images/item4.png" id="item4" mouseOver="itemOver(event)" mouseOut="itemOut(event)" completeEffect="Fade"></mx:Image>
                      </mx:VBox>           
                  </mx:HBox>

       

       

       

      when i try to change the source of an image on mouse over  with AC3 all the other element position change  for split of a second, how do I prevent this from happening?

      this is the code:

       

      public function itemOver(event:MouseEvent):void {
                  currentItem = event.currentTarget.name.replace('item', '');          

                  this['item'+currentItem].source = 'myNewOverImage.png'
      }

       

       

      thank you very much a head and surry for my poor english