Quantcast
Channel: Adobe Community : All Content - Adobe Animate CC - General
Viewing all articles
Browse latest Browse all 13519

Button Click and Mouse over - (what i need in the text)

$
0
0

Hi there, sorry to bother you guys again but i came up with some new questions.

 

I want to try and with a button click on it a an image apears and disapears, but so far i only got this piece of code

 

 

botao.addEventListener(MouseEvent.CLICK, mudaimagem); 


function mudaimagem (event:MouseEvent):void { 
          if (event.currentTarget.selected == true) {                    imagem.visible = false;          }          else {                    imagem.visible = true;
 } 
} 

 

But the thing is ... when i press "CTRL + ENTER" the image still stays on the stage and when i click the button it does not make the image hide.

 

i would like to have some help to know what i am doing wrong ... i have a filing that "if (event.currentTarget.selected == true)" is the thing wrong ... but i am not sure

 

And also if the is a way to do the mouse over on button and image apears the disapear when mouse is not over, i would like to know

 

Thanks for the patince and NOOB questions that i am making.

 

Regards ASilva


Viewing all articles
Browse latest Browse all 13519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>