# \[FMX\] Semi-Dynamic Masking Gallery

**URL:** https://forum.kirupa.com/t/fmx-semi-dynamic-masking-gallery/56171
**Category:** flash
**Created:** [July 1, 2004, 6:48am UTC](https://forum.kirupa.com/t/fmx-semi-dynamic-masking-gallery/56171 "2004-07-01T06:48:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![quik](https://avatars.discourse-cdn.com/v4/letter/q/e19b73/32.png) [@quik](https://forum.kirupa.com/u/quik)
#### Post date: [July 1, 2004, 6:48am UTC](https://forum.kirupa.com/t/fmx-semi-dynamic-masking-gallery/56171/1 "2004-07-01T06:48:59Z")

</div>

Right. here goes… I’m loading 10 jpg images into \_root.content.section\_4.mc\_anim, each is placed into its own movieClip.

```auto
_root.content.section_4.mc_anim["gall_img_"+img_view_index]

```

These movieclips are hidden and then have the images from an array loaded into them.

```auto

images = ['ourwork_01', 
		  'ourwork_02', 
		  'ourwork_03', 
		  'ourwork_04', 
		  'ourwork_05', 
		  'ourwork_06', 
		  'ourwork_07', 
		  'ourwork_08', 
		  'ourwork_09', 
		  'ourwork_10'];

```

so something like:

```auto

loadGallObj(path+images[img_load_index]+ext);

```

anyway, I have made a few masks, these masks are attached to the movie each time the imgTrans() function is called (every 5 seconds using setInterval()).

```auto

imgTrans = function(){
	mc_mask = _root.content.section_4.attachMovie(masks[mask_index], "mc_mask", 10);
	mc_mask._x = 72;
	mc_mask._y = 185;
	_root.content.section_4.img_view_last_index = (_root.content.section_4.img_view_last_index+1)%10;
	_root.content.section_4.mc_anim["gall_img_"+img_view_index]._alpha = 99;
	_root.content.section_4.mc_anim["gall_img_"+img_view_index].setMask(mc_mask);
	_root.content.section_4.mc_anim["gall_img_"+img_view_last_index].setMask(null);
	_root.content.section_4.mc_anim["gall_img_"+img_view_last_index]._alpha = 0;
	trace("Last image:"+img_view_last_index);
	_root.content.section_4.mask_index = (_root.content.section_4.mask_index+1)%_root.content.section_4.masks.length;
	_root.content.section_4.img_view_index = (_root.content.section_4.img_view_index+1)%_root.content.section_4.images.length;
};

```

Its all a bit of a mess really, apologies…  
Anyway, these transitions work great, although after the last image is shown it is not hidden, I can’t quite work out how to loop the array back around like I have done with:

```auto

	_root.content.section_4.mask_index = (_root.content.section_4.mask_index+1)%_root.content.section_4.masks.length;

```

Does that all make sense?  
Any ideas? 🙂
