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 looe the cool effect of transistioning from one image to the other.
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.