Discovery Gaming Community
Actionscript 2.0 - Printable Version

+- Discovery Gaming Community (https://discoverygc.com/forums)
+-- Forum: The Community (https://discoverygc.com/forums/forumdisplay.php?fid=4)
+--- Forum: Real Life Discussion (https://discoverygc.com/forums/forumdisplay.php?fid=16)
+---- Forum: Software & Hardware (https://discoverygc.com/forums/forumdisplay.php?fid=17)
+---- Thread: Actionscript 2.0 (/showthread.php?tid=64060)



Actionscript 2.0 - jxie93 - 07-31-2011

I've been trying to learn AS2 for the past week along with Flash. But I've come to this road block which frustrates me to no end. So I was hoping some of you might know Actionscript or just smart enough to help me out.

Here's what I have

- A button (as a movie clip, instance name "btn") on the first frame
- The same button (also movie clip) but with glow effect on frame 10
- An actionscript layer with key frames on 1 and 10

Here's my code on the action layer (frame 1)

Code:
stop();

function gotoOver()
{
    this.gotoAndStop(10);
}

function gotoOut()
{
    this.gotoAndStop(1);
}

btn.onRollOver = gotoOver;
btn.onRollOut = gotoOut;

I'm trying to make the button glow whenever a mouse is over it. But when I compile and export the swf it just refuses to do the glowing part. When I hover my mouse over the button the cursor turns into a hand but it doesn't glow.

Yes I know I could have used a button instance but I'm trying to learn event handlers here.

Can you help?

edit: I just tested it again by throwing in a this._alpha = 50 along with the onRollOver handler and it seems to work, it's just the gotoAndStop at frame commands that don't work. I also tried referring to the frames using label names and it still won't work.



Actionscript 2.0 - atlantis2112 - 07-31-2011

Code:
btn.onRollOver = gotoOver();
btn.onRollOut = gotoOut();

Try that. I haven't done AS since January but I'll try to help.


Actionscript 2.0 - Vladimir - 08-01-2011

If i remember it right, you can just create the button with different stances, including the one when mouse is over it, and use it.


Actionscript 2.0 - jxie93 - 08-01-2011

Alright, Josh is so kind to help me with AS2 at the moment.

Thanks anyway!