all groups > flash actionscript > january 2005 >
You're in the

flash actionscript

group:

dynamic image reveal



dynamic image reveal Jacqueline Jansen
1/3/2005 9:05:27 PM
flash actionscript: I've been searching, but not sure what to search for, so here goes:

Effect I'm searching for:
I'm working in MX Pro 2004 and I would like to start with a dynamically
loaded jpg within a MC... then, depending on what frame you go to (from a
button - main menu) a new image will reveal (simple mask reveal - left to
right - 0-250 px) over the top of the current image... leaving visibility of
the bottom image until the top image is fully revealed. I currently have
this set up in a linear fashion - on timeline with 6 images, obviously this
will not work because the user experience is not linear...

Can anyone suggest a way to achieve this? Or point me to a similar tutorial?

Thanks much,

Jacqueline

Re: dynamic image reveal kglad
1/4/2005 4:28:31 AM
create a maskMC that's to be your mask. it should have the correct height and
position that you want. create an array of your pics in picA. you can then
use:

ivar = 0;
picA = [];
rclip = _root.createEmptyMovieClip("holder"+ivar+"MC", ivar);
rclip.loadMovie(picA[ivar]);
btn1.onPress = function() {
this.enabled=0;
sclip = rclip;
ivar++;
rclip = _root.createEmptyMovieClip("holder"+ivar+"MC", ivar);
rclip.loadMovie(picA[ivar]);
preloadI = setInterval(preloadF, 80, rclip, sclip);
};
function preloadF(rclip, sclip) {
if (rclip.getBytesLoaded()>0 &&
rclip.getBytesLoaded()>=rclip.getBytesTotal()) {
clearInterval(preloadI);
maskMC._width = 10;
rclip.setMask(_root.maskMC);
maskI = setInterval(applyMask, 80, sclip);
}
}
function applyMask(mc) {
maskMC._width += 5;
if (maskMC._width>=250) {
clearInterval(maskI);
unloadMovie(mc);
if(ivar<picA.length-1){
btn1.enabled=1;
}
}
}

p.s. you'll need to decide what you want to do when the last pic is reached.
Re: dynamic image reveal Jacqueline
1/4/2005 2:48:01 PM
thanks! Haven't tested yet, but I really appreciate it! I'll let you know if
this works for me.


[quoted text, click to view]

Re: dynamic image reveal kglad
1/5/2005 3:38:42 AM
AddThis Social Bookmark Button