SenthilKumar
SenthilKumar

Reputation: 9

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.

Upvotes: 0

Views: 1354

Answers (2)

bmleite
bmleite

Reputation: 26880

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)

Upvotes: 1

Florian F
Florian F

Reputation: 8875

  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(...)];

Upvotes: 0

Related Questions