How to make a rollover state play a filter on a movie clip

Posted by lexikes 
How to make a rollover state play a filter on a movie clip
January 09, 2010 10:31PM
Can anyone give me a brief "how to" on setting a flasheff 2 rollover state to play a filter effect on another movie clip?
thanks!
Re: How to make a rollover state play a filter on a movie clip
January 20, 2010 09:37PM
To achieve that you will have to use the FlashEff2 ROLL_OVER event in order to detect when the rollOver happens and apply a flasheff2 filter effect to another object from the stage. Bellow is a sample code that creates and apply a flasheff2 filter to a certain movieClip when another object animated with flasheff2 is rollover.


// Import the necessary classes.
import com.jumpeye.Events.FLASHEFFEvents;
import com.jumpeye.flashEff2.filter.reflection.FEFReflection;

//adding the rollover event to flasheff instance from the stage that has the instance name set to "myEffect"
myEffect.addEventListener(FLASHEFFEvents.ROLL_OVER, rollOverHandler);

//the bellow function creates a flasheff2 filter and apply it to a movieclip each time the other flasheff is rollover
function rollOverHandler(evtObj:FLASHEFFEvents):void
{

// Create the FlashEff2Code instance and add it to the stage. The Fl
// component must be in the display list in order for it to work.
var effect:FlashEff2Code = new FlashEff2Code();
addChild(effect);

// Create the reflection filter instance and set it up as you need.
var reflection:FEFReflection = new FEFReflection();
reflection.refresh = false;
reflection.reflectionAlpha = 0.8;
reflection.reflectionRatio = 160;

// Add the filter to the FlashEff2Code instance.
effect.addFilter(reflection);
// Set the target object to the FlashEff2Code instance. Once you do this,
// the filter will be applied immediately.
effect._targetInstanceName = "myImage";

}

For more information about how to use the component by code , please check the AS3 documentation file that is included in the flasHEff2 downloaded package.

I hope this helps



Edited 1 time(s). Last edit at 01/20/2010 09:38PM by florodebat.
Re: How to make a rollover state play a filter on a movie clip
February 22, 2010 09:39PM
This code is not working. I've also followed a similar example in the ActionScript3.0 Usage.pdf and the rollover events don't fire in either example. I've checked and rechecked all of naming, library items, and there are also no compile errors.

I'm using FlashEff2 Premium in Flash CS4 on Mac OS 10.6.2

Any ideas, or updated code out there with a working example of using the FLASHEFFEvents.ROLL_OVER event?
Re: How to make a rollover state play a filter on a movie clip
March 08, 2010 10:16PM
ikanski,

I've just double checked the above code and it is working fine for me. Please open a new support ticket attach your source files along with a detailed description and someone will take a closer look to find what exactly goes wrong there.

[www.jumpeyecomponents.com]
Sorry, you do not have permission to post/reply in this forum.