Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : layered photos


spookman
5/3/2004 11:03:32 PM
I have a movie clip and I want to put two png images in the movie, one on top
of the other so the bottom one shows through parts of the transparent top png.

Can someone suggest how to do this?

thanks
Bryan


mandingo
5/4/2004 1:20:33 AM
What you want to do is create a mask layer to allow the lower .png to appear beneath the upper .png

hope that helps
spookman
5/4/2004 1:58:59 AM
How can I create/insert into a particlar layer if I do mak e a mask layer on
my timeline? I can make my movie clip have two layers and put one image on
layer 1, and the other (behind) on layer2. But I do not know how to
insert/remove a png so it is in a particular layer when doing this from Action
Script.

thanks
Bryan

rlc5611
5/4/2004 9:34:59 AM
You cannot insert into layers with AS but you can make two empty movieclip
holders (myclip1 and myclip2) on the stage and, during runtime, use
attachMovie. Make your two PNG images into movie clips and set them to export
for actionscript (say png1 and png2).

myclip1.attachMovie(png1,newpng1,2);//load to depth of 2
myclip2.attachMovie(png2,newpng2,3);//load to depth of 3

myclip2 will be on top of myclip1. Then you can swap depths to change the
order like myclip1.swapDepths(myclip2);
change the alpha if you want, etc.

AddThis Social Bookmark Button