PDA

View Full Version : Creating Events on jpg's loaded dynamically


rwmoulton
02-12-2003, 03:41 AM
Here' s an easy one...
Want to create a simple portfolio where I dynamically load in the thumbnails. I want to attach a RollOver event to each to eventually bring up the larger image. Seems simple, the thumbnails get created, but I just can't get the RollOver events to work.

---------------------------
imgCnt = 4;

for (i = 1; i <= imgCnt; i++) {
_root.createEmptyMovieClip('mc'+i,i);
with (_root['mc' + i]) {
_x = i*60;
_y = 350;
loadMovie("thumb_" + i + ".jpg");
}

//Create Click Event
_root['mc' + i].onRollOver = function(){
trace(i); //Just do something for now
}
}

CyanBlue
02-12-2003, 08:30 AM
Howdy... Welcome aboard... :)

Maybe this thread (http://www.actionscript.org/forums/showthread.php3?s=&threadid=13830) will be of help???

rwmoulton
02-12-2003, 06:37 PM
Thanks for the quick response. I've got some studying to do before I can even figure out if this will help!!

rwmoulton
02-14-2003, 03:46 PM
Thanks for the link, but I think I'm too much off a newbie to figure out how this code can be applied to my problem. Any other hints?

buggedcom
02-14-2003, 05:45 PM
if you want a gallery kinda thing use my imageweaver component. it's hopefully pretty easy to set up with all the documentation i put into it but it's still in beta and there are a few errors but the main functions work perfectly. there's no preview at the moment but you can find documentation at

http://www.buggedcom.co.uk/forum/viewtopic.php?t=2

the download is

http://imageweaver.buggedcom.co.uk

the final release will be ready soon.