all groups > flash actionscript > october 2005 >
You're in the

flash actionscript

group:

onEnterFrame weirdness - need sleuthing help


Re: onEnterFrame weirdness - need sleuthing help 2m
10/15/2005 12:00:00 AM
flash actionscript:
Hi,

I tried, but couldn't reproduce in an emtpy fla.
So if you really want us to help, you might post the fla.
Question is the logo clip still present on the "bgOut" Frame?
onEnterFrame weirdness - need sleuthing help Dave Mennenoh
10/15/2005 9:03:26 AM
I have this code on the main timeline, setting up an onEnterFrame for a clip
named logo to fade out:

logo.onEnterFrame = function() {
if (this._alpha-10>0) {
this._alpha -= 10;
} else {
trace("wtf!");
this._alpha = 0;
this._y = -200;
delete this.onEnterFrame;
_root.gotoAndStop("bgOut");
}
};
stop();

So, once the alpha reaches 0, I see 'wtf!' get trace, and I go to "bgOut"
which is the next frame where nearly the same code happens, except on a
background clip. All fine except - about 5 - 10 times through my background
fade loop, on the next frame, the code inside the else above executes -
resulting in another 'wtf!' being traced and my background clip starting its
fade again. The second time the background fades out entirely, but always
the first time this code executes. I have tried setting the
logo.onEnterFrame = null but that doesn't fix it. I have a workaround in
place now, but can anyone tell me what I'm doing wrong. I'd like to know why
this is happening.

thanks


Dave

Re: onEnterFrame weirdness - need sleuthing help Dave Mennenoh
10/15/2005 2:48:18 PM
[quoted text, click to view]

Yeah, it is still present. But shouldn't the delete this.onEnterFrame
prevent the enterFrame from firing?

Another question: when does delete this.onEnterFrame fail?

--
Dave -
www.blurredistinction.com/director
www.macromedia.com/go/team

Re: onEnterFrame weirdness - need sleuthing help 2m
10/15/2005 9:15:08 PM
my guess would be, that you might in way re-intanciate yuor logo clip with maybe a new keyframe, and therefor it starts over once again.
AddThis Social Bookmark Button