Copy link to clipboard
Copied
Alright I am new at actionscript but what I wanna do is when my button it is pressed once it brings up my input text("hiddentext") and when its pressed again it will remove it.
here is what I got.
button1_btn.addEventListener(MouseEvent.CLICK, shoot_1);
function shoot_1(event:MouseEvent):void
{
gotoAndStop("hiddentext");{
and shoot_1 is just the identifier to make them work together.
Message was edited by: dogmer punchy
A nice clean way of dealing with this is to put the text inside a movieclip and control the visibility of the movieclip with the button, toggling it to be the opposite of what it currently is. If you were to assign an instance name to that movieclip like "hiddenText", the code for toggling it could be...
button1_btn.addEventListener(MouseEvent.CLICK, shoot_1);
function shoot_1(event:MouseEvent):void
{
hiddenText,visible = !hiddenText.visible;
}
The use of the " ! " tells it to be what it is
...Copy link to clipboard
Copied
A nice clean way of dealing with this is to put the text inside a movieclip and control the visibility of the movieclip with the button, toggling it to be the opposite of what it currently is. If you were to assign an instance name to that movieclip like "hiddenText", the code for toggling it could be...
button1_btn.addEventListener(MouseEvent.CLICK, shoot_1);
function shoot_1(event:MouseEvent):void
{
hiddenText,visible = !hiddenText.visible;
}
The use of the " ! " tells it to be what it is not.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now