Groups | Blog | Home
all groups > flash actionscript > april 2007 >

flash actionscript : scripting a highlight of a graphic using onMouseOver


geoffthompson
4/1/2007 12:00:00 AM
Thanks for the ideas...

Option 2 certainly makes more sense to me:

[Q]but it would be more efficient to create two different bitmaps that would
be alternatively displayed on rollover and rollout[/Q]

Given my current script above, can you provide me with an idea as to how I'd
go about doing this? I'm theorizing that I need to script the x,y placement of
these bitmaps and script their fades into one another but am at a loss as to
how to do so. Can you provide an example?
skanKyweed
4/1/2007 12:00:00 AM
just a quick question
wouldn't it be more easy if codes are used rather than bitmaps,
hence the flash becomes lighter
please let me know
geoffthompson
4/1/2007 12:00:00 AM
I'm embarassed to say I really don't know. I'm extremely new to flash and
learning from kind individuals such as yourself, the Actionscript Bible and
tutorials...

Whichever method you feel is best works for me.
geoffthompson
4/1/2007 3:44:05 AM
Hi all,

I'm new to AS and having some issues creating a highlight on a graphic
separate from my button. On the stage is button (b1) and a graphic (image of a
house). I would like the graphic's brightness to increase when the user
mousesover and decreases when the users mousesoff. Can this be done in AS?

The button script currently works like this:

b1.onRollOver = over;
b1.onRollOut = out;
b1.onRelease = hit;

function over () {
this.gotoAndPlay(2);
}
function out () {
this.gotoAndPlay(11);
}
function hit () {
gotoAndPlay("Scene 2", 1);
kglad
4/1/2007 4:57:46 AM
you can convert your graphic to a movieclip and use the bitmapdata class to
copy your movieclip to a bitmap (using the draw method) and then you can do
pixel by pixel adjustment of your bitmap (using getPixel and setPixel) on
rollover and rollout.

but it would be more efficient to create two different bitmaps that would be
alternatively displayed on rollover and rollout.
AddThis Social Bookmark Button