I'm currently working on an artistic project and have run into a slight set back. I need to load a collection of images in a grid and allow a user to choose a few of the images and then move on to something else based on the images. I'm trying to figure out how I can hide a variable or bit of information in the image object so that the flash script can determine the appropriate path.
Try putting each image in it's own movie clip container, then storing variables related to that image on the clip instance.
eg
//load some images in
clip0.loadMovie("image0.jpg");
clipN.loadMovie("imageN.jpg");
//set an property of the clip
clipN._alpha = 50;
//set an author defined variable
clipN.imageTitle = "this is an image of a car";
//mouse event to zoom in on an image etc
clipN.onRelease = function() {
this.activeImage = N;
this.gotoAndPlay("zoom");
}
Yeah, it's all about movieclips in MX. They were made to be VERY powerful.
You can reference them via their name and then variable/method/property.
ie.
movieClip._width = the width of the movie (property)
movieClip.myHP = the Hit Points of this character movie clip (variable)
movieClip.flip(vertically) = a method of the movie clip that passes an argument as well.
These 3 abilities of Movie Clips add a LOT of power.
Bookmarks