| Ultrashock Forums
• Help with MC Visibility |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
|
2010-02-04
#2 |
||
|
|
2010-02-04
#3 |
||
|
|
2010-02-04
#4 |
||
|
Ok - let's take a small step back so that I (being a thicko) can get a definite understanding of your setup. Am I right in thinking that you have 2 MCs on stage? One called "popUp0" and one called "hl"? Is there an MC on stage anywhere called "popUp0hl"? |
|
|
2010-02-08
#5 |
||
|
I appologize for the confusion here. I have a botton named popUp0 and a MC named popUp0hl. When the user clicks on the button popUp0 I want to take that name and and "hl" so that I then have the name of the MC I want to control. By the way I have multiple instances ie, popUp0, popUp1, popUp2, etc. So what I did was to create 2 arrays, one with the names of the buttons and the other with the names of the MCs and use the index of one to referrence the other giving me the corresponding MC for that button. But what I wanted to do was take the evt.target.name and add "hl" on to it. This worked but the this[highlight].visible = true; does not. Thanks man.
|
|
|
2010-02-09
#6 |
||
|
Ok cool - I think I understand. I think you need to use getChildByName to get hold of the MovieClip and also cast it as a MovieClip. Try this: Code:
popUp1.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownBtn);
popUp2.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownBtn);
popUp3.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownBtn);
function onMouseDownBtn(me:MouseEvent):void{
//trace(me.target.name);
var btnName:String = me.target.name;
var mcName:String = btnName + "_mc";
var mc:MovieClip = getChildByName(mcName) as MovieClip;
mc.visible = false;
}
|
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


5 comments
| 143 views




Linear Mode
Could that lowercase/uppercase "L" in highLight / highlight be your problem?