Home
> FlashEff 2.0
> Topic
Filter effect gets applied only once from AS3
Posted by user658046
Filter effect gets applied only once from AS3 April 06, 2011 02:49PM | Registered: 13 years ago Posts: 4 |
Hi... Im trying to create an AS3 code which applies a show animation with a Glow filter, and after certain time, animate it to hide, change the text in the target Textfield and go back with the show animation and the filter.
Everything works OK the first time (when it shows, it applies the transition and the glow filter), but when I detect the event of hiding, when doing the "show" method, the animation plays OK, but without the glowing filter... I have traced "myEffect.filterList.length" on the termination event and it says it has 1 element (the glow filter), so I don't know why it is not aplying the filter the second time... I'll try to pseudocode what Im doing:
public function testFlashEff() {
var glowPattern: FEFGlow = new FEFGlow();
glowPattern.color = 16777215;
glowPattern.alphaPercent = 50;
glowPattern.blurX = 8;
glowPattern.blurY = 8;
glowPattern.quality = 2;
glowPattern.strength =2;
glowPattern.inner = false;
glowPattern.knockout = false;
myEffect = new FlashEff2Code();
addChild(myEffect);
myEffect.setXML(xmlEffect); //XML contains the show and hide transition...
myEffect.showAutoPlay = false;
myEffect.hideAutoPlay = true;
myEffect.hideDelay = 2;
myEffect.addFilter(glowPattern);
trace("?? CONSTRUCTOR " + myEffect.filterList.length); //It traces 1 (OK)
myEffect._targetInstanceName = "txt4";
myEffect.addEventListener(FLASHEFFEvents.TRANSITION_END, transitionEndHandler);
myEffect.show();
}
private function transitionEndHandler(e:FLASHEFFEvents):void{
trace("END: " + FlashEff2Code(e.target).currentTransitionType);
if(FlashEff2Code(e.target).currentTransitionType=="hide"){
trace((new Date()).toString());
txt4.text = (new Date()).milliseconds.toString();
trace("?? " + myEffect.filterList.length); //It says 1 (OK)
myEffect.show();
trace("?? " + myEffect.filterList.length); //It says 1 (OK)... but doesn't apply the glow filter when showing
}
}
What am I doing worng?
One more thing... where can I find the documentation for the other classes in FlashEff2? I have only found documentation for FlashEff2Code class, but not for FLASHEFFEvents or any of the filters, for example...
THANK YOU!
Everything works OK the first time (when it shows, it applies the transition and the glow filter), but when I detect the event of hiding, when doing the "show" method, the animation plays OK, but without the glowing filter... I have traced "myEffect.filterList.length" on the termination event and it says it has 1 element (the glow filter), so I don't know why it is not aplying the filter the second time... I'll try to pseudocode what Im doing:
public function testFlashEff() {
var glowPattern: FEFGlow = new FEFGlow();
glowPattern.color = 16777215;
glowPattern.alphaPercent = 50;
glowPattern.blurX = 8;
glowPattern.blurY = 8;
glowPattern.quality = 2;
glowPattern.strength =2;
glowPattern.inner = false;
glowPattern.knockout = false;
myEffect = new FlashEff2Code();
addChild(myEffect);
myEffect.setXML(xmlEffect); //XML contains the show and hide transition...
myEffect.showAutoPlay = false;
myEffect.hideAutoPlay = true;
myEffect.hideDelay = 2;
myEffect.addFilter(glowPattern);
trace("?? CONSTRUCTOR " + myEffect.filterList.length); //It traces 1 (OK)
myEffect._targetInstanceName = "txt4";
myEffect.addEventListener(FLASHEFFEvents.TRANSITION_END, transitionEndHandler);
myEffect.show();
}
private function transitionEndHandler(e:FLASHEFFEvents):void{
trace("END: " + FlashEff2Code(e.target).currentTransitionType);
if(FlashEff2Code(e.target).currentTransitionType=="hide"){
trace((new Date()).toString());
txt4.text = (new Date()).milliseconds.toString();
trace("?? " + myEffect.filterList.length); //It says 1 (OK)
myEffect.show();
trace("?? " + myEffect.filterList.length); //It says 1 (OK)... but doesn't apply the glow filter when showing
}
}
What am I doing worng?
One more thing... where can I find the documentation for the other classes in FlashEff2? I have only found documentation for FlashEff2Code class, but not for FLASHEFFEvents or any of the filters, for example...
THANK YOU!
Re: Filter effect gets applied only once from AS3 April 07, 2011 07:18AM | Admin Registered: 15 years ago Posts: 547 |
Re: Filter effect gets applied only once from AS3 April 07, 2011 07:24AM | Registered: 13 years ago Posts: 4 |
I'm applying a show and hide transition, but I haven't put it in my message for space saving... the show and hide transitions are set when assigning the XML to myEffect variable (myEffect.setXML(xmlEffect);)
I didn't write down the XML in the message as I thought it didnt have anything to do with the problem as the glow effect appears the first time, but not when I call the myEffect.show() at the end event... and the XML defining the show and hide transitions, and the glow effect on the myEffect variable are the same!
I didn't write down the XML in the message as I thought it didnt have anything to do with the problem as the glow effect appears the first time, but not when I call the myEffect.show() at the end event... and the XML defining the show and hide transitions, and the glow effect on the myEffect variable are the same!
Re: Filter effect gets applied only once from AS3 April 07, 2011 01:36PM | Admin Registered: 15 years ago Posts: 547 |
Re: Filter effect gets applied only once from AS3 April 07, 2011 02:04PM | Registered: 13 years ago Posts: 4 |
I finally solved it... I really don't know how, but now it works... here's what I have changed... I have taken ou some of the properties from the XML (the ones related to the show and hide transition) and assigned them as properties of the object.
I suppose that one of the properties assigned from the XML conflicted with what I did from code and that's why the glow effect appeared only in the beginning... Thank you very much anyway.
By the way ... where can I find the documentation for the other classes in FlashEff2? I have only found documentation for FlashEff2Code class, but not for FLASHEFFEvents or any of the filters... I know, for example, that the FEFGlow class has a "knockout" property, but I found out by analyzing the XML generated from the Flasheff Panel...
Thank you
I suppose that one of the properties assigned from the XML conflicted with what I did from code and that's why the glow effect appeared only in the beginning... Thank you very much anyway.
By the way ... where can I find the documentation for the other classes in FlashEff2? I have only found documentation for FlashEff2Code class, but not for FLASHEFFEvents or any of the filters... I know, for example, that the FEFGlow class has a "knockout" property, but I found out by analyzing the XML generated from the Flasheff Panel...
Thank you
Re: Filter effect gets applied only once from AS3 April 07, 2011 02:28PM | Admin Registered: 15 years ago Posts: 547 |
We created flasheff online panel [www.flasheff.com] from which you can take each property of a filter by using copy code feature.
[screencast.com]
Note The online panel is available only for premium plus users.
[screencast.com]
Note The online panel is available only for premium plus users.
Re: Filter effect gets applied only once from AS3 April 07, 2011 02:50PM | Registered: 13 years ago Posts: 4 |
Re: Filter effect gets applied only once from AS3 April 08, 2011 08:20AM | Admin Registered: 15 years ago Posts: 547 |
In the ActionScript3.0 Usage.pdf manual you can find properties, methods events for the flasheff2code. You can access an effect propertiesby using online panel, or you can get them as you did by analyzing the xml generated by Flasheff Panel, but this is just a way around to get access to the properties for the premium user.
Sorry, you do not have permission to post/reply in this forum.