so here's the function on main stage:

function slideImage(btnNum:Number)
{
trace("scrolling image");
trace(btnNum);

var myTween2:Tween = new Tween(imageObjects, "x", Strong.easeOut, imageObjects.x, imageObjects.x - 600, 1.5, true);
}


and here's the code that wants to call this function in a another movie clip. I've attached this clip dynamicaly to the main stage as well.

var btnNumber;

this.addEventListener(MouseEvent.CLICK, gotoLink);

function gotoLink(event:MouseEvent)
{
trace(btnNumber);
slideImage(btnNumber);
}


How can i acess slideImage function on the main stage. in AS2 _root.slideImage(btnNumber); would work. How Would I do this in AS3?

Apreciate your help. Thank you.