Hi
I am trying to target a button contained within a movie clip that i am dynamically loading from the library. I am loading the clip with the following code,
var newClip:MovieClip = container_mc(“container”);
function loadReservation ():Void
{
attachMovie(“container_mc”, “container”, 0);
removeMC(defaultContent_mc);
container._y = 150.8 ;
container._x = 10;
}
That loads the movie clip fine.
Then i am trying to target a button (closeResDetailsBtn) inside the container movie clip (that is now on stage). I have tried the following
container.closeResDetailsBtn.onRelease = function ()
{
trace(“its worked”);
}
and
container_mc.closeResDetailsBtn.onRelease = function ()
{
trace(“its worked”);
}
neither option works, i have also tried creating a variable in my code for the button with
var newButton:Button = closeResDetailsBtn(“close”);
and using
close.onRelease = function ()
{
trace(“its worked”);
}
Basiclly i need the button closeResDetailsBtn to close the container movie clip.
Does anyone know what i am missing please?
Cheers
Liam.