flash actionscript:
[quoted text, click to view] "Stckman" <webforumsuser@macromedia.com> wrote in message news:e0ovc0$k5g$1@forums.macromedia.com...
> Hi. I was trying to create a series empty moviclips that i would fill with
> dynamic images and then be able to click on each. (photo gallery)
>
> I did manage to make a bunch of dynamically created movie clips. but when i
> try to add a onPress to any of the dynamically created movie clips nothing
> works. No hand no nothing. what am i doing wrong. i also tries this with
> onRelease. onMouseUp or onMouseDown does it no matter where youclick. i want it
> to work on the specifically created movieclip. any tips?
You can either wait until the pictures load completely before positioning and assigning button actions, or the way I do it is to
make a double clip that allows me to position everything and assign button actions without waiting for the loading process..
mc1.mc2
mc1 is the base clip and can be used right away to set alpha, position, assign button actions
mc2 will load the image and we don't need to wait for it to finish.
// make the base clip 'box' at depth 10
this.createEmptyMovieClip("box",10);
var mc = this["box"];
//make the sub-clip 'holder' inside of the base clip at depth 11
mc.createEmptyMovieClip("holder",11);
// start loading a picture into the sub-clip
mc.holder.loadMovie("picture1.jpg");
// do anything you need to do to the base clip without waiting for the picture to load
mc.idNum = num;
mc._x = 100;
mc._y = 100;
mc.onPress = function()
{
info.text = this.idNum;
this._alpha = 30;
}
Here is an example of loading 9 thumbnail jpegs and using them (their base clips) as buttons..
http://www.kompanionkare.net/flash/buttons/imageButtons.html tralfaz