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);
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 ()
container_mc.closeResDetailsBtn.onRelease = function ()
neither option works, i have also tried creating a variable in my code for the button with
var newButton:Button = closeResDetailsBtn(“close”);
close.onRelease = function ()
Basiclly i need the button closeResDetailsBtn to close the container movie clip.
Does anyone know what i am missing please?