Be a Supporter!

Can you help me with a button?

  • 154 Views
  • 5 Replies
New Topic Respond to this Topic
Spiritto
Spiritto
  • Member since: Oct. 16, 2009
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Can you help me with a button? 2009-10-16 15:46:14 Reply

Hello flash pros!

I need help with a simple button.
I have a cow button prepared, and also a MOO sound:

All I want is the cow to go MOO when I click the button, not when I pass the mouse over the button, but when I click it.
I suppose I need to write an On release action.

Can you help me? I'm taking my first steps on action script

JKR
JKR
  • Member since: Jan. 1, 2005
  • Offline.
Forum Stats
Member
Level 29
Animator
Response to Can you help me with a button? 2009-10-16 15:48:14 Reply

What version are you using? AS 2.0 or 3.0?


BBS Signature
Spiritto
Spiritto
  • Member since: Oct. 16, 2009
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Can you help me with a button? 2009-10-16 15:53:13 Reply

I'm using Action Script 2.0

JKR
JKR
  • Member since: Jan. 1, 2005
  • Offline.
Forum Stats
Member
Level 29
Animator
Response to Can you help me with a button? 2009-10-16 16:18:51 Reply

See if this helps:

http://www.kirupa.com/developer/actionsc ript/sound.htm

It is a full tutorial that will likely help you, rather than just code. If that doesn't work, I guess reply again so someone can give you direct code for your situation. I hope that helps!


BBS Signature
Spiritto
Spiritto
  • Member since: Oct. 16, 2009
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Can you help me with a button? 2009-10-16 16:44:11 Reply

Thank you very much for the link. But I'm afraid I'm looking for something slightly different.

I want the cow to say MOO only once, when clicking the button. Then, if you click it again, it will go MOO once more, but not in a loop.

JKR
JKR
  • Member since: Jan. 1, 2005
  • Offline.
Forum Stats
Member
Level 29
Animator
Response to Can you help me with a button? 2009-10-16 17:27:04 Reply

If you read the description of why the code does what it does, it explains how to not loop it. That's why I didn't just paste in the code, so you could see why it does what it does. If you want the straight up code, someone else can probably write it for you. I figured understanding it would do more for you in the future than just copying code. Up to you, though.

Good luck.


BBS Signature