Groups | Blog | Home
all groups > flash actionscript > february 2005 >

flash actionscript : Can I set "onRollOut = false"?


David Stiller
2/21/2005 5:00:53 PM
[quoted text, click to view]

You bet. I'm not sure if setting it to false succeeds. I usually
delete the handler ...

delete this.onRollOut;

... or ...

this.onRollOut = null;


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

highlander_1
2/21/2005 9:49:41 PM
Maybe a weird question??
I have a anymous function in my first frame.
Can I set "this.onRollOut = false" and disable onRollOut for a few seconds?
You know - make that "this.onRollOut" not work when I?m moving my cursor
out of the button area. (only for a few seconds)


:-)

Heres the code in the first frame:

this._alpha = 32;
trace(_alpha);
stop();
this.onRollOver = function() {
if (rollover == true) {
this.kund4FadeOut.gotoAndStop("lastframe");
}else{
this.gotoAndStop("Over");
}
};

this.onRollOut = function() {
if (pressing == true) {
this.kund4Over.gotoAndStop(11);
} else if ((this.kund4Hit.lastframe == true) && (_parent.rotate == true)){
// this.gotoAndStop(1); med detta statemnet blir alpha 32 igen - varf?r?
this._alpha = 100;
} else {
this.gotoAndStop("FadeOut");
}
};

this.onPress = function() {
this.gotoAndPlay("Hit");
pressing = true;
};
abeall
2/21/2005 10:27:47 PM
I'm intrigued by what you mean when you say 'only for a few seconds' - what do
you intend to happen after those few seconds? Does the original handler get
re-activated? And if the user rollsOur during those few seconds of disabled
event, what do you expect to happen when the rollOut is re-enabled? It get's
called as if there was a rollOut(which is not reall logical)? And perhaps most
importantly, what are you trying to do this for?
abeall
2/21/2005 11:02:11 PM
Correction: Above I said: > And if the user rollsOut during those few seconds
of disabled event, what do you > expect to happen when the rollOut is
re-enabled? It get's called as if there was a > rollOut? What I meant was:
.... what do you expect to happen when the rollOut is re-enabled? Do you want it
to get called as if there was a rollOut? This is not what would happen, as a
rollOut is a specific event when the mouse transitions from being over to not
being over. So that's all ro say, depending on what you are trying to do,
there are different ways to 'disable' a rollout for a few seconds. But using
delete will certainly kill it completely, if that's what you want.
highlander_1
2/22/2005 4:04:34 AM
The problem is that the onRollOut is trigged before a animation is done, if
you?r to fast to "rollout" your mouse.

Answer to you question is:

On a "6 ButtonsMenu" I?ll display where I?ve clicked. (the menu remember
where I?ve been)
The "just clicked button" has the alpha 100 and not alpha 32.

MORE IN DETAIL
1. After the animation is done in mc "kund4Hit" (a nested mc i mckKund4 that
acts like a button )
a variable called "lastframe" is set to true and alpha i set to 100 in that
nested mc.
2. After the alpha i set to 100 the timeline should move on to parent timeline
and load a "slideShow.swf".
3. After I closed the slide show I`ll return to a navigation of 6 buttons
(laying under the slideshow).
Than I could see which button has the apha 100. Alpha is set to 100 on that
"button" I?ve just clicked - mcKund4.

But again.
If I click and rollOut my mosue to fast without a short delay (so the
animation could run in mc called "kund4Hit",
and lastframe in that mc is set to true, and a statement thats tell the
timline to move to _parent and load the the slideShow)
nothing happends and I will prevent that.

:-)


AddThis Social Bookmark Button