-
1. Re: Movieclips interacting with other movieclips
Ned Murphy Oct 9, 2013 3:07 PM (in response to mentalcase129)The answer will lie in how you coded things. Show the code for one of the buttons and explain where the button is versus the object it is trying to impact.
-
2. Re: Movieclips interacting with other movieclips
mentalcase129 Oct 9, 2013 5:09 PM (in response to Ned Murphy)Okay here's the code. Basically it makes all the movieclip images labeled IMG_number invisible until their corresponding buttons make them visible. This code is located on the same timeline as the IMG files but the buttons are contained within a movieclip on that timeline.
IMG1_MC.visible=false;
IMG2_MC.visible=false;
IMG3_MC.visible=false;
IMG4_MC.visible=false;
IMG5_MC.visible=false;
IMG6_MC.visible=false;
IMG7_MC.visible=false;
img1_MC.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
IMG1_MC.visible=true;
IMG2_MC.visible=false;
IMG3_MC.visible=false;
IMG4_MC.visible=false;
IMG5_MC.visible=false;
IMG6_MC.visible=false;
IMG7_MC.visible=false;
}
img6_MC.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler2);
function fl_MouseClickHandler2(event:MouseEvent):void
{
IMG1_MC.visible=false;
IMG2_MC.visible=false;
IMG3_MC.visible=false;
IMG4_MC.visible=false;
IMG5_MC.visible=false;
IMG6_MC.visible=true;
IMG7_MC.visible=false;
}
img2_MC.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler8);
function fl_MouseClickHandler8(event:MouseEvent):void
{
IMG1_MC.visible=false;
IMG2_MC.visible=true;
IMG3_MC.visible=false;
IMG4_MC.visible=false;
IMG5_MC.visible=false;
IMG6_MC.visible=false;
IMG7_MC.visible=false;
}
img3_MC.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler3);
function fl_MouseClickHandler3(event:MouseEvent):void
{
IMG1_MC.visible=false;
IMG2_MC.visible=false;
IMG3_MC.visible=true;
IMG4_MC.visible=false;
IMG5_MC.visible=false;
IMG6_MC.visible=false;
IMG7_MC.visible=false;
}
img4_MC.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler4);
function fl_MouseClickHandler4(event:MouseEvent):void
{
IMG1_MC.visible=false;
IMG2_MC.visible=false;
IMG3_MC.visible=false;
IMG4_MC.visible=true;
IMG5_MC.visible=false;
IMG6_MC.visible=false;
IMG7_MC.visible=false;
}
img5_MC.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler5);
function fl_MouseClickHandler5(event:MouseEvent):void
{
IMG1_MC.visible=false;
IMG2_MC.visible=false;
IMG3_MC.visible=false;
IMG4_MC.visible=false;
IMG5_MC.visible=true;
IMG6_MC.visible=false;
IMG7_MC.visible=false;
}
img7_MC.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler6);
function fl_MouseClickHandler6(event:MouseEvent):void
{
IMG1_MC.visible=false;
IMG2_MC.visible=false;
IMG3_MC.visible=false;
IMG4_MC.visible=false;
IMG5_MC.visible=false;
IMG6_MC.visible=false;
IMG7_MC.visible=true;
}
-
3. Re: Movieclips interacting with other movieclips
Ned Murphy Oct 9, 2013 7:49 PM (in response to mentalcase129)You explained that the buttons are inside a movieclip. You need to target the buttons via targeting that movieclip... If that movieclip happens to be named btnMC for instance you need to use....
btnMC.img1_MC.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);


