I was wondering if this was possible:
I have a scrollpane and code on frame 1 of my main timeline:
_root.counter = 0;
var i:Number=0;
var mcMain:MovieClip;
function init() {
//empty movie clip in library with linkage name "scrollMovieClip"
scrollPane.contentPath = "scrollMovieClip";
mcMain = scrollPane.content;
//trace(mcMain);
}
init();
scrollPane._visible = false;
textBox._visible = false;
btnClose._visible = false;
backBox._visible = false;
shopPork.onRelease = function() {
mcMain.attachMovie("pork", "test"+i, mcMain.getNextHighestDepth(),{_y:62*i+5, _x:5});
i++;
scrollPane.invalidate();
_root.counter += 1;
}
}
but the movieclip I’ve referenced above [COLOR=blue]shopPork[/COLOR] is located inside a movie clip called [COLOR=blue]porkDetai[/COLOR]l and [COLOR=blue]porkDetail[/COLOR] is located inside a movie clip called [COLOR=blue]Print1[/COLOR]. This is the code that is on Frame 1 of the [COLOR=blue]Print 1[/COLOR] movie clip:
var buttonListener:Object = new Object();
buttonListener.change = function(evt:Object) {
// when the current row changes in the DataGrid, launch a new popup window displaying the product's details.
myWindow = mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, true, {title:evt.target.selectedItem.name, contentPath:"ProductForm", closeButton:true});
// set the dimensions of the popup window.
myWindow.setSize(340, 210);
// define a listener which closes the popup window when the close button in the upper right-hand corner is clicked.
var closeListener:Object = new Object();
closeListener.click = function(evt) {
evt.target.deletePopUp();
};
myWindow.addEventListener("click", closeListener);
}
Obviously when I run this the shopPork.onRelease function does not work. Is there some way I can get this function to work when the code is on the main timeline and the movieclip is located several layers up? I was thinking something like the reverse of _parent._parent, but I can’t seem to find any info on this. Is this even possible to do? Thank you.