hide / show / Delay

Posted by steenjensen 
hide / show / Delay
February 15, 2009 12:18PM
Iam kinda new to the Flasheff so iam trying to make some easy task with some simple code, just to understand the FlashEff.

I have 3 buttons they should make 3 movies (text) fade/Blur in and out......

But cant get it to work properly: First of all the showDelay = 2 should it not make it to wait 2 sec before it starts the "show();" command (its start right away, and even without the FESBlur(); ) the hide(); seems to work!

Sorry for taking up your time, but iam lost, tryed all kind of stuff from your webside, i just cant to get it right ;(

Hope someone can help me, i paste the code i have so far ;)

/S

-------------------------------------------------------------------------

import com.jumpeye.flashEff.symbol.blur.FESBlur;

var myPatternOUT:FESBlur = new FESBlur();
myPatternOUT.tweenDuration=1;
myPatternOUT.blurX=20;
myPatternOUT.blurY=20;

var myPatternIN:FESBlur = new FESBlur();
myPatternIN.tweenDuration=2;
myPatternIN.blurX=80;
myPatternIN.blurY=20;
//myPattern.blurQuality=myblurQuality;

var HomeEffect:FlashEff = new FlashEff();

HomeEffect.hideTransition = myPatternOUT;
HomeEffect.hideDelay = 0;
HomeEffect.hideAutoPlay = false;

HomeEffect.showTransition = myPatternIN;
HomeEffect.showDelay = 2;
HomeEffect.showAutoPlay = false;
this.addChild(HomeEffect);
HomeEffect._targetInstanceName = "home_txt";


var ContactEffect:FlashEff = new FlashEff();

ContactEffect.hideTransition = myPatternOUT;
ContactEffect.hideDelay = 0;
ContactEffect.hideAutoPlay = false;

ContactEffect.showTransition = myPatternIN;
ContactEffect.showDelay = 2;
ContactEffect.showAutoPlay = false;
this.addChild(ContactEffect);
ContactEffect._targetInstanceName = "contact_txt";


var SignupEffect:FlashEff = new FlashEff();

SignupEffect.hideTransition = myPatternOUT;
SignupEffect.hideDelay = 0;
SignupEffect.hideAutoPlay = false;

SignupEffect.showTransition = myPatternIN;
SignupEffect.showDelay = 2;
SignupEffect.showAutoPlay = false;
this.addChild(SignupEffect);
SignupEffect._targetInstanceName = "signup_txt";



addEventListener(MouseEvent.CLICK,buttonClicked);

function buttonClicked(e:MouseEvent){

trace(".........."+e.target.name+" "+e.type);

if(e.target.name == "home_butt"){
HomeEffect.show();

if(contact_txt.alpha > 0.1){
ContactEffect.hide();}

if(signup_txt.alpha > 0.1){
SignupEffect.hide();}
}

if(e.target.name == "contact_butt"){
ContactEffect.show();

if(home_txt.alpha > 0.1){
HomeEffect.hide();}

if(signup_txt.alpha > 0.1){
SignupEffect.hide();}
}

if(e.target.name == "sign_up_butt"){
SignupEffect.show();

if(home_txt.alpha > 0.1){
HomeEffect.hide();}

if(contact_txt.alpha > 0.1){
ContactEffect.hide();}
}
}



import com.jumpeye.Events.FLASHEFFEvents;

HomeEffect.addEventListener(FLASHEFFEvents. TRANSITION_END, transitionEndHandler);

function transitionEndHandler(evtObj: FLASHEFFEvents):void {

trace("ENDDDDDDDDDD");

}
Re: hide / show / Delay
February 16, 2009 02:39PM
I'm not sure what are you trying to do here. If I figured this out correctly you have 3 textfields and 3 buttons. Every time you click a button 2 texfield disappear leaving only one. You're problem is that you use only one instance of FLahsEFF for 3 Simultaneous effects and you are overwriting the targetInstanceName parameter of FlasheEff, that's why they do not worl. You need to create new FlashEff for every textfield.
If this does not work either or if you have any other questions please write back.

Ionut
Re: hide / show / Delay
February 16, 2009 02:58PM
Well iam trying to have one textfield blur in, and the one allrdy there ( alpha > 0.1 ) to blur out/disappear...

So if i understand you right this is not the right way? :
var HomeEffect:FlashEff = new FlashEff();
var ContactEffect:FlashEff = new FlashEff();
var SignupEffect:FlashEff = new FlashEff();

thanks again for respoding

Steen
Re: hide / show / Delay
February 16, 2009 04:53PM
Ahhh now I got it ;)

Now i can make it into a loop... ;)

Thanks again....




-------------------------------------

var myPatternOUT1:FESBlur = new FESBlur();
myPatternOUT1.tweenDuration=1;
myPatternOUT1.blurX=20;
myPatternOUT1.blurY=20;

var myPatternIN1:FESBlur = new FESBlur();
myPatternIN1.tweenDuration=2;
myPatternIN1.blurX=80;
myPatternIN1.blurY=20;

var myPatternOUT2:FESBlur = new FESBlur();
myPatternOUT2.tweenDuration=1;
myPatternOUT2.blurX=20;
myPatternOUT2.blurY=20;

var myPatternIN2:FESBlur = new FESBlur();
myPatternIN2.tweenDuration=2;
myPatternIN2.blurX=80;
myPatternIN2.blurY=20;

var myPatternOUT3:FESBlur = new FESBlur();
myPatternOUT3.tweenDuration=1;
myPatternOUT3.blurX=20;
myPatternOUT3.blurY=20;

var myPatternIN3:FESBlur = new FESBlur();
myPatternIN3.tweenDuration=2;
myPatternIN3.blurX=80;
myPatternIN3.blurY=20;
Sorry, you do not have permission to post/reply in this forum.