Ok.. use currentState=null  instead currentState=""


 
2006/5/29, rama satoskar <[EMAIL PROTECTED]>:
Hi,

I tried using rollOver and rollOut . But this worsened the situation.
After the application loads and my mouse rolls over the images ones,
the prices are seen once. But the rollOut doesn not et triggered. the
viewState does not come back to the original state.

Why does this happen??
Any idea!!

I am pasting the complete code below:
******************
viewstate2.mxml
******************

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml "
layout="absolute">
       <mx:Script>
               <![CDATA[
                       import mx.controls.listClasses.*;
                       import mx.controls.Image;

                       // the data to display in Tile List
                       [Bindable]
                       public var catArr:Array = [
                       {
                                 name: "Suzuki CatStreet",
                 data: "1",
                 price: "129.99",
                 image: "bike1.JPG",
                 thumbnail: "bike1.JPG",
                 description: "So, ride the catStreet"
            },
            {     name: "Avenger",
                 data: "1",
                 price: "99.99",
                 image: "bike2.jpg",
                 thumbnail: " bike2.jpg",
                 description: "Just like 007 used"
            },
            {    name: "TOYOTA Racing car",
                 data: "1",
                 price: " 49.99",
                 image: "car1.jpg",
                 thumbnail: "car1.jpg",
                 description: "Better than Dick Tracy's"
            },
            {    name: "Earth Eating Moon",
                 data: "1",
                 price: "19.99",
                 image: "wallpaper1.jpg",
                 thumbnail: "wallpaper1.jpg",
                 description: "Computer-powered cool!!!"
             },
             {   name:"Jet Alight",
                 data:"1",
                 price: "204.99",
                 image: "wallpaper2.jpg",
                 thumbnail:" wallpaper2.jpg",
                 description:"A man setting up the jet"
             }
           ];


    ]]>
       </mx:Script>

       <mx:TileList id="myList" itemRenderer="imagecomp"
dataProvider="{catArr}"
       columnWidth="150" rowHeight="150" width="500" height="500"/>
   <mx:TextArea width="200" height="100" id="t1" wordWrap="true"
x="74" y="319"/>
   <mx:Label x="0" text="Description" y="320"/>

</mx:Application>

*********************
imagecomp.mxml
********************
<?xml version="1.0" encoding="utf-8"?>
<!-- The itemRenderer that formats the contents of each cell in the
       TileList control.
   When the mouse pointer goes over a cell, this component changes
its state
       to showdesc.
   When the mouse pointer goes out of the cell the component returns
to the
       base state. -->
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml " width="400"
height="300" horizontalAlign="center"
       verticalAlign="top"  rollOver="currentState='showdesc'"
rollOut="if(!event.relatedObject)currentState=''">
       <!-- In the base state, display the image and the label. -->
<mx:Image id="img1" source="{data.image}" width="50"  height="50"
       resizeEffect="Resize" />
<mx:Label text="{data.name}"/>

<mx:states>
   <mx:State name="showdesc">
       <!-- In the showdesc state, add the price, make the image
bigger, and
           put the description in the parent application's TextArea. -->
       <mx:AddChild>
               <mx:Text text="{data.price}"/>
       </mx:AddChild>
       <mx:SetProperty target="{img1}" name="width" value="85"/>
       <mx:SetProperty target="{img1}" name="height" value="85"/>
       <mx:SetProperty target="{ parentApplication.t1}" name="text"
           value="{data.description}"/>
   </mx:State>
</mx:states>
</mx:VBox>
************************************************************************

--- In [email protected], "Luís Gustavo Sanabio"
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
>     Try to use rollOver and rollOut  instead mouseOver, mouseOut.
>
> Gustavo Sanabio
> Brazil
>
>
> 2006/5/27, rama satoskar <[EMAIL PROTECTED]>:
> >
> > Hi everyone,
> >
> > I am using a image structure as an item renderer in a tilelist which
> > is populated from a data array. The application runs an resizes the
> > image when on the 'mouseOver' and 'mouseOut' triggers.the image
> > resizes from a 50 width to 85.
> >
> > However i observed that after moving the mouse over the image five to
> > six times...it does not resize the image........and stays static at 85
> > width.
> >
> > The code of the item renderer is given below.
> > <?xml version="1.0" encoding="utf-8"?>
> > <!-- The itemRenderer that formats the contents of each cell in the
> >        TileList control.
> >    When the mouse pointer goes over a cell, this component changes
> > its state
> >        to showdesc.
> >    When the mouse pointer goes out of the cell the component returns
> > to the
> >        base state. -->
> > <mx:VBox xmlns:mx=" http://www.adobe.com/2006/mxml" width="400"
> > height="300" horizontalAlign="center"
> >        verticalAlign="top" mouseOver="currentState='showdesc'"
> > mouseOut="if(!event.relatedObject)currentState=''">
> >        <!-- In the base state, display the image and the label. -->
> > <mx:Image id="img1" source="{ data.image}" width="50"  height="50"
> >        resizeEffect="Resize" />
> > <mx:Label text="{data.name}"/>
> >
> > <mx:states>
> >    <mx:State name="showdesc">
> >        <!-- In the showdesc state, add the price, make the image
> > bigger, and
> >            put the description in the parent application's
TextArea. -->
> >        <mx:AddChild>
> >                <mx:Text text="{data.price}"/>
> >        </mx:AddChild>
> >        <mx:SetProperty target="{img1}" name="width" value="85"/>
> >        <mx:SetProperty target="{img1}" name="height" value="85"/>
> >        <mx:SetProperty target="{parentApplication.t1}" name="text"
> >            value="{data.description}"/>
> >    </mx:State>
> > </mx:states>
> > </mx:VBox>
> >
> > is it becoz of some default property of the resize effect??
> > i am confused.
> > Kindly help.
> >
> >
> >
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>







------------------------ Yahoo! Groups Sponsor --------------------~-->
Home is just a click away. Make Yahoo! your home page now.
http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links

<*> To visit your group on the web, go to:
   http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
   [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to