PDA

View Full Version : Fading Button's


grimfandango18
06-03-2006, 11:27 AM
Would it be possible to create a fading button? say the button starts at about 30% opacity, but once the user puts mouse over button it fades into full opacity. Please if you can manage this please provide and example for me, thanks guys :) .

Intrigued
06-03-2006, 12:08 PM
You can use the Image object's Action Image.SetOpacity(). However, you do not get multiple button-like states.

Try this:

1. Open a new, blank project
2. Create a new Image object (with a darker colored image)
3. Set the Image object's (see: Property panel) Opacity to say 10.
4. Double-click on the Image object and go to the On Enter event area
4. Copy/Paste in the code shown below these directions
5. Preview (F5) said project and move the mouse over the Image object

for n=1, 90 do
Application.Sleep(10)
Image.SetOpacity("Image1", n)
end

Dialog.Message("Message...", "Image's opacity now at 100 percent! All done!")

grimfandango18
06-03-2006, 01:40 PM
Thanks Intrigued, your code worked really well, the only thing that is strange is right before it fades it kind of flashes to white then fades, its hard to explain but maybe you have some more ideas. Thanks

I have one more request, ok there was this popular program from a few years back called Kai's super goo, and the interface had some cool effects, like when you put your mouse over one of the buttons it kind of rippled like water, is anything like this possible in ams? Thanks in advance.

Wonderboy
06-03-2006, 01:50 PM
If you want effects like that , i would suggest using a flash object insted,that way you can use any effects you want.

Intrigued
06-03-2006, 10:36 PM
Thanks Intrigued, your code worked really well, the only thing that is strange is right before it fades it kind of flashes to white then fades, its hard to explain but maybe you have some more ideas. Thanks

I have one more request, ok there was this popular program from a few years back called Kai's super goo, and the interface had some cool effects, like when you put your mouse over one of the buttons it kind of rippled like water, is anything like this possible in ams? Thanks in advance.

Replace the other code with:

for n=11, 100 do
Application.Sleep(10)
Image.SetOpacity("Image1", n)
end

Dialog.Message("Message...", "Image's opacity now at 100 percent! All done!")

And take a look at this offering presented by another forum user for the "effects" end of things:

http://www.indigorose.com/forums/showthread.php?t=15441&highlight=water+effect