Hi list,

I have a vBox container with a backgroundImage
(bg1.jpg). When rollover  the backgroundImage ,I want
to display another backgroundImage (bg2.jpg) at the
same position ( swap).

The below code doesn't work properly .  When I
rollout, the background2 (sometimes)  shows and when I
rollover back it, background1 doesn't show .

What is the right way to do this? I'm newbie.
Thanks!
yoko

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
<mx:Script>
        <![CDATA[
        [Bindable]
        private var bgSrc:String="assets/bg1.jpg";

        private function onItemRollOver():void{
                bgSrc="assets/bg2.jpg";
        }
        private function onItemRollOut():void{
                bgSrc="assets/bg1.jpg";
        }               
                
        ]]>
</mx:Script>
        
                
        
        <mx:VBox id="myVbox"  x="0" y="0" width="100"
height="100" paddingTop="20"  horizontalAlign="center"
 rollOver="onItemRollOver();"
rollOut="onItemRollOut();" backgroundImage="{bgSrc}">
                <mx:Image id="myThumb" source="assets/thumbnail.jpg"
/>
                <mx:Text id="myText" text="product1"  />                        
                                                                
        </mx:VBox>
        
        
</mx:Application>


      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Reply via email to