I have two movie clips called mc_England and mc_Scotland they are on separate layers but placed on the stage in the same position.
When I click the close button on one of the clips I can't tell which close button I'm clicking.
If I move the two movie clips onto different parts of the stage the code below works correctly.
I'm probably missing something simple but I cant see what?
Any help would be great.
UPDATE:
As the Close button being in the same position was causing the problem.
I decided to set the position of each Movie clip to come on and off stage.
This works apart from the FinishTween not completing before re positioning the movie clip.
Is there a way to set the position after a tween has completed?
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import flash.display.MovieClip;
//Buttons Open
btn_England_Open.addEventListener(MouseEvent.CLICK, England_Open);
btn_Scotland_Open.addEventListener(MouseEvent.CLICK, Scotland_Open);
//Button Close
mc_England.btn_England_Close.addEventListener(MouseEvent.CLICK, England_Close);
mc_Scotland.btn_Scotland_Close.addEventListener(MouseEvent.CLICK, Scotland_Close);
//Open Functions
function England_Open(e:MouseEvent){
StartTween(mc_England);
}
function Scotland_Open(e:MouseEvent){
StartTween(mc_Scotland);
}
//Close Function
function England_Close(e:MouseEvent){
FinishTween(mc_England);
}
function Scotland_Close(e:MouseEvent){
FinishTween(mc_Scotland);
}
//Tween Function
useSeconds);
function StartTween(target:MovieClip){
target.x = 386.90;
target.y = 195.00;
var myTween:Tween = new Tween(target, "alpha", Strong.easeIn, 0, 1, 0.5, true);
//myTween.start();
}
//Tween Function
function FinishTween(target:MovieClip){
var myTween:Tween = new Tween(target, "alpha", Strong.easeOut, 1, 0, 0.5, true);
//myTween.start();
target.x = -100;
target.y = -100;
}