PDA

View Full Version : onEnterFrame and alpha fade not working


bjones8050
05-18-2005, 01:39 PM
Hi,

THE PROBLEM:
Incrementing alpha channel onEnterFrame, runs very inconsistent with lots of XML data. Runs fine with fewer items, but adding say 20 items makes things run very irradically.

THE BACKGROUND:
I've attached a small menu project I'm working on that has me stumped. I am loading XML data into flash for the menu, each xml "item" includes a title, description and an image link.

Flash loads in the xml, then, using MovieClipLoader() it consecutively displays each menu items title and desc as a button, once the items image has loaded. It also makes each of the images alpha set to 0 except the first.

When someone clicks a menu button, using onEnterFrame, I am telling the image for the item clicked to increment the alpha channel up from 0 until it reaches 100. once it reaches 100 I set the previous images alpha to zero, delete the onEnterFrame and we're done.

Works great, except with lots of XML data (like 20 or so) the incremental alpha channel onEnterFrame works very inconsistently, just chopping in for some, coming in really slow for others, and towards the very bottom of the script runing normal.

I thought it might not be deleting the onEnterFrame and gettign messed up but I'm pretty sure that is working OK.

Is there any reason loading 20 or so XML items would cause major performance problems?

Any thoughts are greatly appreciated, thanks for your time!

Eliseo
05-18-2005, 02:16 PM
there are problems when we put severals MCs with _alpha=0 in the same place (I think that 11 is the most number of MC with _alpha not equal 0 or 100)
try put _visible=false, and only make the images you want fade in/fade out _visible=true

bjones8050
05-18-2005, 03:24 PM
Thanks for your reply,

I think I understand what you're saying, set all images to _visible false, except for the two images I'm using at the moment (prev image, next image) which I can transition from 0 up to 100? yes? thanks for your help I'll give it a try.