Pan,

 

            You are actually running into a scoping problem. You don’t get an error because your effectTriggers are using strings instead of effect instances. Try changing rollOverEffect=”zoomIn” to rollOverEffect=”{zoomIn}”. You should get an error complaining that zoomIn doesn’t exist.

 

The problem is that when you use inline components, the component must be self-contained. It has no access to objects in the parent app. If you move the two zoom effects into the VBox component, then your effects will play. I’ve included an updated version. Notice that I had to set the scrollPolicy of the VBox to prevent scrollbars from appearing during the zoom.

 

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

 

  <mx:ArrayCollection id="dataSet">

    <mx:source>

      <mx:Object><mx:Month>January</mx:Month><mx:Costs>20</mx:Costs></mx:Object>

      <mx:Object><mx:Month>February</mx:Month><mx:Costs>60</mx:Costs></mx:Object>

      <mx:Object><mx:Month>March</mx:Month><mx:Costs>90</mx:Costs></mx:Object>

    </mx:source>

  </mx:ArrayCollection>

 

  <mx:DataGrid id="grid" dataProvider="{dataSet}" width="100%" height="100%">

    <mx:columns>

     <mx:DataGridColumn>

      <mx:itemRenderer>

       <mx:Component>

                 <mx:VBox verticalScrollPolicy="off" horizontalScrollPolicy="off">

                                      <mx:Zoom id="zoomIn" zoomWidthTo="2" zoomHeightTo="2" />

                                      <mx:Zoom id="zoomOut" zoomWidthTo="1" zoomHeightTo="1" />

            <mx:Text text="some text" width="100%" rollOverEffect="{zoomIn}" rollOutEffect="{zoomOut}"/>

          </mx:VBox>

       </mx:Component>

      </mx:itemRenderer>

     </mx:DataGridColumn>

     <mx:DataGridColumn dataField="Month"/>

     <mx:DataGridColumn dataField="Costs"/>

    </mx:columns>

  </mx:DataGrid>

</mx:Application>

 

Jason

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Pan Troglodytes
Sent: Monday, June 19, 2006 1:07 PM
To: flexcoders
Subject: [flexcoders] adding zoom effect to datagrid row

 

I'm having a real time trying to get a rolloverEffect to work on a datagrid.  What I want is for the text to zoom a little bit when rolled over.  Here's my code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
  <mx:ArrayCollection id="dataSet">
    <mx:source>
      <mx:Object><mx:Month>January</mx:Month><mx:Costs>20</mx:Costs></mx:Object>
      <mx:Object><mx:Month>February</mx:Month><mx:Costs>60</mx:Costs></mx:Object>
      <mx:Object><mx:Month>March</mx:Month><mx:Costs>90</mx:Costs></mx:Object>
    </mx:source>
  </mx:ArrayCollection>
  <mx:Zoom id="zoomIn" zoomWidthTo="2" zoomHeightTo="2" />
  <mx:Zoom id="zoomOut" zoomWidthTo="1" zoomHeightTo="1" />

  <mx:DataGrid id="grid" dataProvider="{dataSet}" width="100%" height="100%">
    <mx:columns>
     <mx:DataGridColumn>
      <mx:itemRenderer>
       <mx:Component>
          <mx:VBox>
            <mx:Text text="some text" width="100%" rollOverEffect="zoomIn" rollOutEffect="zoomOut"/>
          </mx:VBox>
       </mx:Component>
      </mx:itemRenderer>
     </mx:DataGridColumn>
     <mx:DataGridColumn dataField="Month"/>
     <mx:DataGridColumn dataField="Costs"/>
    </mx:columns>
  </mx:DataGrid>
</mx:Application>


But the effect never happens.  I've tried a lot of different variations with no luck.

--
Jason

__._,_.___

--
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