|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ActionScript 3 - Since when do I have to declare an MC???!!
Since when do I have to "declare" an mc to set it's _visible status???!!!
lol, this is very frustrating. I just have a plain old MC on the stage named mcCross1 and I want to set it's _visible to false on my actionscript frame.... How do I go about doing this? THank you. |
|
#2
|
|||
|
|||
|
Hi, there is no _visible in ActionScript 3, it's visible without the underscore. When you say it's named mcCross1 do you mean that's its library name or do you mean you have given the copy on the stage an instance name via the properties panel. You have to do the later to be able to reference it to set its visible property. Well, technically you don't have to if you know its index in its parents display list but I'm assuming you don't want to do that!
__________________
Quis custodiet ipsos custodes?
|
|
#3
|
|||
|
|||
|
Thank you very much. It's been way too long since I've done this stuff.
How would I go about changing the visible property of an instance on the stage from a button? |
|
#4
|
|||
|
|||
|
You would give the button an instance name, associate an event handler with it which in turn sets the visible property of your mcCross1 clip:
Code:
your_button.addEventListener(MouseEvent.MOUSE_DOWN, this.doPress);
function doPress(event:MouseEvent):void
{
mcCross1.visible = false;
// Or as a toggle on/off
// mcCross1.visible = !mcCross1.visible;
}
|
|
#5
|
|||
|
|||
|
Works.
Much appreciated. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > ActionScript 3 - Since when do I have to declare an MC???!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|