all groups > flash actionscript > april 2004 >
You're in the

flash actionscript

group:

Flash MX 2004: Button problem


Re: Flash MX 2004: Button problem Jack.
4/14/2004 7:28:24 PM
flash actionscript:
for Flash Player 5, use onClipEvent(mouseDown)
and the hitTest method.

Re: Flash MX 2004: Button problem Jack.
4/14/2004 8:35:46 PM
[quoted text, click to view]

by using hitTest, for example

onClipEvent(mouseDown){
if(this.hitTest(_level0._xmouse,_level0._ymouse,1)){
Flash MX 2004: Button problem Anthony
4/14/2004 9:01:52 PM
Hi,

I want to make a button which alternatively stops the sound and restart
it. The aspect of the button also changes each time it is clicked. I already
managed to do it using a clip and the following script:

on (release) {
if (_root.music == true) {
gotoAndStop(3);
_root.music = false;
stopAllSounds();
} else if (_root.music == false) {
gotoAndStop(1);
_root.music = true;
_level1.gotoAndPlay(1);
}
}

The problem is that the swf file must be compatible with Flash Player 5
and this player doesn't support "on (release)" actions on a clip.

How can I get the same result being compatible with Plah Player 5?

Thank you in advance,

Anthony

Re: Flash MX 2004: Button problem Anthony
4/14/2004 10:29:41 PM
Thank you Jack for your answer.

I tried with "onClipEvent(mouseDown)". It works but the actions are executed
even if I click anywhere on the stage !

How can I limit the active zone to the clip (button)?

Thank you again.

Anthony

"Jack." <webforumsuser@macromedia.com> a écrit dans le message de
news:c5k3co$sa7$1@forums.macromedia.com...
[quoted text, click to view]

Re: Flash MX 2004: Button problem Anthony
4/14/2004 10:40:23 PM
Thank you very much Jack. It works now.

Anthony

"Jack." <webforumsuser@macromedia.com> a écrit dans le message de
news:c5k7b2$46i$1@forums.macromedia.com...
[quoted text, click to view]

AddThis Social Bookmark Button