Flex ToolBox: AdvancedImage

Feb 25, 2009

My new AdvancedImage component takes a few seperate and common needs for an image and rolls it into one nice package. AdvancedImage will allow you to easily define rounded corners (seperatly), pass in a rollover DisplayObject and will even handle cross-dissolves. I needed to provide this component to someone newer to Flex so I tried to makes it's use as simple as possible.

<graphics:AdvancedImage
    id="myExample"
    width="150"
    height="170"
    topRightCornerRadius="8"
    bottomRightCornerRadius="8"
    source="assets/waterfall.jpg"
    crossOverEffect="{createCOE()}"
    mouseOverObject="{getMouseOverMask()}"
/>

  • crossOverEffect is the effect you wish to use when changing images. when you update myExample.source, if an effect has been defined it will use that method to display the new image on top of the old one. Otherwise myExample.source = "newImage.jpg" will work just like a regular Image component.
  • mouseOverObject is just that. If you pass in a displayObject, on mouse over, that object will be enlarges to the same size as the image and displayed. In my code example I'm just using a simple white canvas with alpha set to 0.46. This is a simpler than expected example of a mouseOverObject.
  • The corner radiuses are applied via a top level Canvas, AdvancedImage actualy extends Canvas, not Image. So any images or mouse overs you pass in will be masked.

<flash source="/FlexApps/CookBook-AdvancedImage/AdvancedImageExample.swf" width="454" height="255" align="center" />

Download the latest version of AdvancedImage

Comments

newbie

newbie wrote on 09/13/09 9:28 PM

Hello,
I tried using your AdvancedImage but every time i add a border to it, the scroll bars appear inside...
can you please help out...?
thanks!
newbie

newbie wrote on 09/13/09 9:30 PM

Hi again just to add to my comment, the rounded corners of the border does not appear either... something is not working properly...
debt consolidation firm

debt consolidation firm wrote on 09/18/09 1:58 AM

i have posted your blog on my site

Write your comment



(it will not be displayed)



Subscribe to this comment thread