i have almost go it working where you click a button and an item inside a MC with the same name gets it visibility toggled. however it seems flash won’t convert my string to a MC name, i have tried lots of things, and need some outside input cause this has me stumped, and i need to get back to being productive:!:
import flash.display.*;
import flash.events.*;
import flash.ui.Keyboard;
var part:MovieClip;
var witch:String;
function clickbh01(event:MouseEvent) {
witch = event.currentTarget.name;
player[part] = player.name+"."+witch;
trace(player[part]);
vistoggle(player[part]);
}
player.h01.alpha = .0;
player.h02.alpha = .0;
player.b01.alpha = .0;
player.gotoAndStop(1);
h01.addEventListener(MouseEvent.MOUSE_DOWN, clickbh01);
function vistoggle(part:MovieClip) {
if (part.alpha == .0) {
part.alpha = 1;
} else {
if (part.alpha == 1) {
part.alpha = .0;
}
}
}
any help would be greatly appreciated :+)
almost forgot here is the output error i get
//output
player.h01
TypeError: Error #1034: Type Coercion failed: cannot convert “player.h01” to flash.display.MovieClip.
at itmeslecttemp_fla::MainTimeline/clickbh01()