alpha = 0 is not the same as visible = false
February 13th, 2008 . by polyGeekI’m working on an image browser to go along with a video player. I noticed that after browsing to the 12th image the loading slowed down considerably.
When an image is replaced it fades to 0 and the image that gets loaded fades to 100. Nothing I haven’t done countless times before.
To fix the slow loading after the 12th image I tested a few things. First I made sure that my reference to the imageLoader was cleaned up. It was. Yeah me. :-)
Then I tried removeMovieClip on the image that faded to 0. That fixed it. Problem is that now I have to load each image every time instead of just fading it back to 100 if it’s already been loaded.
Then I tried setting the visible = false after the image had faded out. That worked. Everything runs smooth.
I would have thought that an alpha = 0 would take that object out of the rendering list but I suppose it doesn’t. If you don’t want the Flash player to be rendering an object set it’s visibility to false.












I think an object with alpha set to 0 still receives mouse events, but one with with visible=false doesn’t…
happiness would not be the same if flash developers had a perfect player :P
@Quentin, correct. visible=false removes the Mouse interaction.
Yep!
That’s why alpha=0 is slower than visible=false…
hehehe, it’s been like that since _alpha=0 exists
another thing to notice: even if out of stage, visible objects slow down the player
Leave a Reply