Copy link to clipboard
Copied
Hi there,
I have a pretty straight forward problem.
I have 2 buttons. YesBtn and NoBtn.
Both buttons should show their respective answer.
YesBtn would reveal text 'yes this is correct' ("end" label), NoBtn would reveal text 'No this is incorrect' ("Incorrect" Label)
I tried doing this on the timeline - but it doesn't work the way I would like it to.
I want to be able to click either button respectively and not worry about where the person may be on the timeline - Hence, if I click on only 'yes' then I don't want the No Button to appear (it does due to timeline).
How could I go about showing and hiding (with opacity over a set time) without using the timeline?
Thanks!
convert each text/background into movieclips (if they're not already movieclips), eg yes_ans and no_ans.:
then if as3, use:
yes_ans.visible = false;
no_ans.visible=false;
yesBtn.addEventListener(MouseEvent.CLICK,yesF);
noBtn.addEventListener(MouseEvent.CLICK,noF);
function yesF(e:MouseEvent):void{
yes_ans.visible=true;
}
function noF(e:MouseEvent):void{
no_ans.visible=true;
}
Copy link to clipboard
Copied
convert each text/background into movieclips (if they're not already movieclips), eg yes_ans and no_ans.:
then if as3, use:
yes_ans.visible = false;
no_ans.visible=false;
yesBtn.addEventListener(MouseEvent.CLICK,yesF);
noBtn.addEventListener(MouseEvent.CLICK,noF);
function yesF(e:MouseEvent):void{
yes_ans.visible=true;
}
function noF(e:MouseEvent):void{
no_ans.visible=true;
}
Copy link to clipboard
Copied
I'm using Html5 Canvas - but thanks big help.
Here's my personal solution.
this.yesAnswer.visible = false //sets the answer to be hidden
Also I found I can make simple tweens using TweenJS - can make things fade in and out instead of just appearing
createjs.Tween.get(target)
.wait(500)
.to({alpha:1, visible:true}, 1000);
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now