PDA

View Full Version : mc with actionscript keeps disappearing


hooman
07-26-2004, 09:52 PM
hi,

i tried searching for this one, but it may be too stupid of a question to have been posted before. i have attached the .swf file, so you can see what i mean. if you click on the "home" button the titles will appear, and the static text slides in. that text is an mc with the following code attached to it:

onClipEvent(load){
_root.home1.txt1._alpha=0;
_root.home1.txt1._x=-50;
}
onClipEvent(enterFrame){
_root.home1.txt1._alpha+=10;
if (_root.home1.txt1._x<20){
_root.home1.txt1._x+=10;
}
}

after clicking on the "home" button, just stay there for a minute or two and the text will disappear. i don't know why this happens, and i was hoping someone could explain this to me; and help me avoid it.

snapple
07-26-2004, 10:58 PM
Can i take a look at your fla? The flash executes the _alpha += 10; command after a while and it fades back in - but i tihnk its pretty impossible to tell why, without looking inside. I have FMX.

Regards, snapple :)

curryjon51
07-27-2004, 06:55 AM
Hi

Seem to remember reading somewhere that if you let the _alpha of anything just go on increasing, eventually it reverts to negative numbers... ie turns invisible. Maybe if you put a limit on the _alpha increment...

if(_alpha<100){
_alpha+=10
}

hth