views:

1031

answers:

3

I am using AS3 to create a tween affect between multiple images that have a drop shadow around them - it works great, except after 3+ tweens the drop shadow starts getting darker and darker - that makes sense, but not really want i want to happen.

Ideally i would like to tween between 2 images, on the 3rd clear it out or something? I am relatively new to AS3 so im sure its a rooky mistake :-)

The steps im taking are: 1.) Load images from xml document int xml class in AS3 2.) On a timer event, load the new image and call the following tween method:

tweener = new Tween(mcSlideHolder1, "alpha", None.easeNone,0,1,2,true);

Please let me know if this is not clear, im trying to be descriptive, but its a bit rough since im not an AS3 expert :-)

UPDATE: I can get the previous to clear and stop the stacking effect by adding:

while( nameOfContainer.numChildren > 0 )
       nameOfContainer.removeChildAt( 0 );

... but if i do that i loose the cool effect of transistioning from one image to the other.

Thank you!!!!

A: 

You could try this: Instead of applying a dropshadow filter to each image individually, Make all images contained within a movieclip and apply the dropshadow filter to that movieclip (remove all dropshadows on images).

sthg
A: 

You have not shown all of your code so it is hard to tell what is going on. But if it continuing to get darker and darker, then I am led to believe that the images are being loaded over and over. Please make more of your code available, particularly the XML complete handler function, and where your adding the child to the display list. We will just have to adjust your code to only add those items the initial time, and then rotate them through the display list, or to constantly remove the last viewed so that it can be leaded in again next time without additional black/bleeding.

If you have a function that loads in these images, then that function gets called again, it loads the assets again on top of the first causing the darkening/bleeding.

http://www.hodgedev.com

Brian Hodge
Yes, the problem was simply that i was stacking them on top of each other. I didnt actually solve the problem, just have it tweening from a solid background instead of from one image to another - not perfect but i can live with it for now.
schmoopy
Please show more code and I can see where to adjust this to achieve what you want. I am assuming you have some timer or for loop that we can just add a small conditional to.
Brian Hodge
A: 

Not sure if it's related or not, but it could be that your shadow gradient is a single large object that is darker in the center and then dissipates towards the edges, and then the shadowing is a mask for this gradient. So if your shadows move closer towards the center, they will appear darker because they are allowing a darker part of the gradient to show.