I was wondering if someone could help me with a simple bit of action script 3. I need to make a movie clip (single_mc) disappear when the user clicks on the mouse (stop_btn). Here’s what I have so far.
function setProperty(event:MouseEvent):void
|
{
single_mc.alpha=0;
}
stop_btn.addEventListener(MouseEvent.CLICK, setProperty);
Also I was wonder if you could recommend an Action script 3 book for me. I would like one that is not a training book, but has situations and then the script written out. For example: I click a button and a movie symbol disappears from the stage. I am a graphic artist, that from time to time, needs simple interaction in flash, but cant justify the time to learn the script.
Thanks for your time
refer the below sample code.
show_btn.addEventListener(MouseEvent.CLICK, showme);
hide_btn.addEventListener(MouseEvent.CLICK, hideme);
function showme(Event:MouseEvent):void
{
your_mc.visible = true;
}
function hideme(Event:MouseEvent):void
{
your_mc.visible = false;
}
or you can hide and show your movieclip using one button also. for this refer the below code.
your_btn.addEventListener(MouseEvent.CLICK, hideshow);
function hideshow(Event:MouseEvent):void
{
if(your_mc.visible == true)
{
your_mc.visible = false;
}
else
{
your_mc.visible = true;
}
}
hope...this will help you ![]()
Thank you very much the second script did just what I wanted.
Also I was wonder if you could recommend an Action script 3 book for me. I would like one that is not a training book, but has situations and then the script written out. For example: How to click a button and a movie symbol disappears from the stage. I am a graphic artist, that from time to time, needs simple interaction in flash, but cant justify the time to learn the script.
Thanks for your time
North America
Europe, Middle East and Africa
Asia Pacific