Run Time MovieClip eventListeners
I'm working on an image gallery which builds dynamically at runtime, simple enough.
imageList is an array loaded with the images to display.
(sorry for the mess, work in progress)
var imageList:Array = _root.images.split(",");
var imageArray = new Array();
var count = 0;
for( var i = 0; i < imageList.length; i++ ){
_root.createEmptyMovieClip("myMC"+i, (i + 1));
_root["tmpMCL"+i] = new MovieClipLoader();
imageArray = new Array();
imageArray = this.createEmptyMovieClip("myMC"+i, (i + 1) );
_root["tmpMCL"+i].loadClip("imagemaker.php?src="+imageList, imageArray);
}
imageArray[0]._x = 10;
imageArray[0]._y = 10;
for( i = 1; i < imageArray.length; i++ ) {
imageArray._x = (( i % 3 ) * 160 ) + 10;
imageArray._y = (Math.floor( i / 3 ) * 160 ) + 10;
}
The images load, in rows of 3, without any trouble. However, I would like to create an onClick or onMouseUp event that will send out a getURL('') command for each of the MovieClips, with differing urls for each obviously, for viewing the full size images.
I've tried doing...
imageArray.onMouseUp = function() {}
imageArray.onClick = function() {}
imageArray.addEventListener( MouseEvent.MOUSE_UP, function() {} )
even a nested...
imageArray.addEventListener( Event.ENTER_FRAME, function() { imageArray.onMouseUp = function () {} } )
But nothing ever happens when I run the file and click on a thumbnail.
Any suggestions?