Ask a Question related to Macromedia Flash, Design and Development.
-
Fry #1
Fading alpha on mouse over/mouse off
Hi,
Wondering if someone could take a minute to help a flash newbie:
I'm trying to create a set of images which fade to 1% alpha when the mouse
is over them and back up to 99% when the mouse is no longer on them. I've
found this actionscript to do it which works with a move clip of a fading
image:
this.onRollOver = function() {
this.onEnterFrame = function() {
if (this._currentframe != this._totalframes) {
this.nextFrame();
} else {
delete this.onEnterFrame;
}
};
};
this.onRollOut = function() {
this.onEnterFrame = function() {
if (this._currentframe != 1) {
this.prevFrame();
} else {
delete this.onEnterFrame;
}
};
};
stop();
The trouble is, i'd prefer it if it faded out faster than it faded back in,
so the images disappears quite quickly, but takes a while longer to fade
back in. Can anyone suggest how I can acheive this?
Any help greatly appreciated, thanks in advance...
Fry Guest
-
Help with Mouse Within and Mouse Leave problem...
I have a shockwave 3d file of a building with individual floors split up into seperate objects. I want a pop-up information box (set at a MARKER)... -
change button alpha on mouse over
Hi I have made plain rectangular buttons for a movie and have set the 'transparent' option to 40% so that the background shows through and the... -
Move mouse cursor to X,Y location and simulate mouse click
Hi, Just something that slip my mind.. but how do you move the mouse cursor to a sprite member and simulate a mouse click? Any help is... -
changing alpha on mouse within
Assuming you've set the blend to 50% in Director you can do it with a behaviour attached to the sprite:- property spriteNum on mouseEnter... -
ps/2 mouse is not loaded by the kernel (neither is usb mouse)
I've been looking all over the net trying trying to solve this problem, I found a few posts where people had the same problem, but no solution. ... -
tralfaz #2
Re: Fading alpha on mouse over/mouse off
You can simplify by not checking for first or last frames. (Flash takes
care of that)
Here is the way I would do it... It's just a variation of the same thing,
but I like easy to read code.
good luck,
tf
//----------------------------------------------------------------------
// All code goes on first frame of movie clip
this.onEnterFrame = function()
{
if(goforward)
this.nextFrame();
else // back up
{
// Multiple lines make it back up faster
this.prevFrame();
this.prevFrame();
this.prevFrame();
}
}
this.onRollOver = function()
{
goforward = 1; // yes
}
this.onRollOut = function()
{
goforward = 0; // no
}
//----------------------------------------------------------------------
"Fry" <NOSPAMnlj@lineone.net> wrote in message
news:bdku7e$ualj5$1@ID-100008.news.dfncis.de...in,> Hi,
> Wondering if someone could take a minute to help a flash newbie:
> I'm trying to create a set of images which fade to 1% alpha when the mouse
> is over them and back up to 99% when the mouse is no longer on them. I've
> found this actionscript to do it which works with a move clip of a fading
> image:
> this.onRollOver = function() {
> this.onEnterFrame = function() {
> if (this._currentframe != this._totalframes) {
> this.nextFrame();
> } else {
> delete this.onEnterFrame;
> }
> };
> };
> this.onRollOut = function() {
> this.onEnterFrame = function() {
> if (this._currentframe != 1) {
> this.prevFrame();
> } else {
> delete this.onEnterFrame;
> }
> };
> };
> stop();
>
> The trouble is, i'd prefer it if it faded out faster than it faded back> so the images disappears quite quickly, but takes a while longer to fade
> back in. Can anyone suggest how I can acheive this?
> Any help greatly appreciated, thanks in advance...
>
>
tralfaz Guest
-
Fry #3
Re: Fading alpha on mouse over/mouse off
> You can simplify by not checking for first or last frames. (Flash
<Snip!>> takes care of that)
> Here is the way I would do it... It's just a variation of the same
> thing, but I like easy to read code.
>
> good luck,
> tf
Thank you VERY much indeed!
Fry Guest



Reply With Quote

