how to get glow effect on one image while mouse over on the another image using flex 3?
i am a new of flex, i have one problem, please solve this.
i have two images , when i mouse over first image at the same time glow effect raised on开发者_开发问答 second image.
Thanks advance. senthil.
If you are using MXML here's a small example how to accomplish that effect:
<mx:GlowFilter id="glowfilter" alpha="0.5" color="#000000"/>
<mx:Image id="image1" source="IMAGE_SOURCE_1"
mouseOver="{ image2.filters = [glowfilter] }"
mouseOut="{ image2.filters = [] }"/>
<mx:Image id="image2" source="IMAGE_SOURCE_2"/>
("IMAGE_SOURCE_1" and "IMAGE_SOURCE_2" are merely illustrative, don't forget to replace by the respective images sources)
- Add an event listener for the roll over in your first image
- In the event handler, add the glow filter to your second image
- Add also an event listener for the roll out, so you can remove the glow
To apply a glow filter :
myImageId.filters = [new GlowFilter(...)];
精彩评论