Youfirst create a Loader object and add it to the MovieClip.
var myLoader:Loader = new Loader();
hover1_mc.addChild(myLoader);
Then you create a stage eventlistener for the mouse click and load the image into the loader randomly.
stage.addEventListener (MouseEvent.CLICK,loadImage);
function loadImage (evt:MouseEvent)
{
var myURLs:Array = new Array("img1.jpg","img2.jpg");
var ranImg:int = Math.random() * 2;
myLoader.load (new URLRequest(myURLs[ranImg]));
}




Reply With Quote