PDA

View Full Version : dynamic drop shadow


jglazener
10-19-2002, 02:46 AM
ok, so i have a script which dynamically generates an image. i would like to then dynamically generate a drop shadow that coorelates with the outer edge of the final image (ie not its component parts) any thoughts?

i suppose if anyone has a great technique for creating soft edge drop shadows that might help also

thanks

Billy T
10-20-2002, 05:14 AM
could do something like this

cheers

jglazener
10-20-2002, 10:05 PM
thanks for the response but its not so simple. that works if i have a rectangle every time, but i am dynamically generating these images. "holder" has maybe twenty movie clips attached to it and is thus completely random in shape and never the same. i want to duplicate holder along with all its subclips. is that possible?

pixelwit
10-21-2002, 06:45 AM
How are you "dynamically generating" these "images"?

-PiXELWiT
http://www.pixelwit.com

jglazener
10-21-2002, 06:50 AM
offstage is a movieclip that has 4 frames, each with a stop()

for every turn of a loop, i attach this into a "holder" clip on stage, randomly pick a frame to stop on, then i distort it in multiple ways.

i go through this loop 20 times or so. in the end "holder" has 20 attached clips in it. i want to duplicate holder and all its subclips.

Billy T
10-21-2002, 07:42 AM
Originally posted by jglazener
i want to duplicate holder and all its subclips.

I thought you were after a shadow but now I'm not so sure

maybe up your fla and explain exactly what you're after

cheers

pixelwit
10-21-2002, 08:06 AM
As you've probably discovered, duplicating a MovieClip does not duplicate the clips attached to it.

To overcome this you need to first duplicate the holder clip and attach clips to the duplicate at the same time you attach clips to your holder. If you want a soft edge you will need to create soft edged versions of the clips you are attaching and attach them to the duplicated holder clip.

I've attached a file and here's the code it uses:Shadow.duplicateMovieClip("Shape", 2);
Shadow._x += 6;
Shadow._y += 6;
for (i=0; i<10; i++){
var x = Math.random()*100;
var y = Math.random()*100;
var r = Math.random()*360
Shadow.attachMovie("ShadowDot", "ShadowDot"+i, i);
shadowDot = Shadow["ShadowDot"+i];
Shape.attachMovie("Dot", "Dot"+i, i);
shapeDot = Shape["Dot"+i];
shadowDot._x = shapeDot._x = x;
shadowDot._y = shapeDot._y = y;
shadowDot._rotation = shapeDot._rotation = r;
}
Shape._xscale = Shadow._xscale = Math.random()*50+75;
Shape._yscale = Shadow._yscale = Math.random()*50+75;
Shape._rotation = Shadow._rotation = Math.random()*360;Hope it helps,

-PiXELWiT
http://www.pixelwit.com

jglazener
10-21-2002, 08:41 AM
ive got it now, thanks