开发者

how to get glow effect on one image while mouse over on the another image using flex 3?

开发者 https://www.devze.com 2023-02-15 23:21 出处:网络
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.

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)


  1. Add an event listener for the roll over in your first image
  2. In the event handler, add the glow filter to your second image
  3. Add also an event listener for the roll out, so you can remove the glow

To apply a glow filter :

myImageId.filters = [new GlowFilter(...)];
0

精彩评论

暂无评论...
验证码 换一张
取 消