I've few movieclip from library that will add to stage, inside of the movieclip have some mc that I want to control it, here is my script.
if (selectDiffText.text == "Collection 1 Easy")
{
var c1_easy:cartoonEasy = new cartoonEasy();
addChild(c1_easy);
c1_easy.x = 412;
c1_easy.y = 400;
TweenMax.from(c1_easy, 0.5, {alpha:0, ease:Expo.easeOut});
}
else if (selectDiffText.text == "Collection 1 Medium")
{
var c1_medium:cartoonMedium = new cartoonMedium();
addChild(c1_medium);
c1_medium.x = 412;
c1_medium.y = 400;
TweenMax.from(c1_medium, 0.5, {alpha:0, ease:Expo.easeOut});
}
else
{
trace("ERROR!");
}
Code above will load particular movieclip from library if the selectDiffText change.
var movieList:Array = [cartoonMedium1,cartoonMedium2,cartoonMedium3,cartoonMedium4,cartoonMedium5,cartoonMedium6];
function getRandomMovie():MovieClip
{
var index:int = Math.floor(Math.random() * movieList.length);
var mcClass:Class = movieList.splice(index,1)[0];
return new mcClass();
}
playGame = getRandomMovie();
addChild(playGame);
let say if c1_medium is added to stage, c1_medium will also randomly added 1 of the movieclip from library on it.
inside of the playGame mc, I've mouseTarget.alpha = 0;...how can I control it from root level? c1_easy also have the mouseTarget.alpha=0 too.