Flex 2 RolloverImage component

December 14th, 2006

I have created a very basic Flex 2 RolloverImage component that allows you to define the up, over, and down images through CSS.

Here is the guts of how to use the class:

XML:
  1. <mx:Style>
  2.   .firstRollover {
  3.     upSkin: Embed(source="/assets/arrowGreenUp.png");
  4.     overSkin: Embed(source="/assets/arrowBlueUp.png");
  5.     downSkin: Embed(source="/assets/arrowBlueDown.png");
  6.   }
  7. </mx:Style>
  8. <renaun:RolloverImage
  9.     styleName="firstRollover"
  10.     click="mx.controls.Alert.show( 'click' );" />
  11. <renaun:RolloverImage
  12.     upSkin="@Embed(source='/assets/arrowBlueUp.png')"
  13.     overSkin="@Embed(source='/assets/arrowBlueDown.png')"
  14.     downSkin="@Embed(source='/assets/arrowGreenUp.png')"
  15.     mouseDown="mx.controls.Alert.show( 'mouseDown' );" />

For a live example click here
, the source is available by right clicking on the component or you can find it here.

Entry Filed under: Adobe Flex, Rich Internet Applications

3 Comments Add your own

  • 1. Bruce  |  2006-12-15 at 8.20 am

    Thanks for posting this component. I’ve downloaded your source code and everything works fine.

    I’m trying to figure out how to create multiple different RolloverImage components in the same application. Your example shows one RolloverImage component tied to the Rollover style declaration.

    How can I create another RolloverImage component with different graphics?

    Thanks

  • 2. Renaun Erickson  |  2006-12-15 at 10.22 am

    The example code in the post, live example, and the download have been updated to demonstrate how to use multiple RolloverImage’s properly. Sorry about that.

  • 3. Bruce  |  2006-12-15 at 4.34 pm

    Thank you. I appreciate your work.

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Disclaimer: I work as a Flash/Flex Developer for Adobe Systems Incorporated. The opinions expressed here represent my own and not those of my employer.

My Amazon.com Wish List

Calendar

December 2006
S M T W T F S
« Nov   Jan »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Most Recent Posts


Flex.org - The Directory for Flex