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

flash actionscript

group:

"ESC" button?


Re: "ESC" button? David Stiller
12/22/2004 5:02:02 PM
flash actionscript: Show us your code?


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

"ESC" button? Maddug
12/22/2004 10:01:07 PM
You know how ESC key will exit from a projector, can you make a graphic button
that uses that command? The FSCommand "Quit" isn't working for what I'm doing,
but hitting the ESC button does.

Thank you.
Re: "ESC" button? Maddug
12/22/2004 10:12:01 PM
This is what I have:

on (release) {
fscommand("quit");
}

It's on a button that I want to close the program with, it's an swf running in
a screensaver. The quit command doesn't work. But hitting ESC on the keyboard
does.
Re: "ESC" button? David Stiller
12/23/2004 8:12:37 AM
Maddug,

Well, your code looks all right, so I would aim for some basic trouble
shooting. Add a trace() to make sure the button is properly firing at all.

on (release) {
trace("Quit button was clicked.");
}

See if you get that message in your Output panel. Maybe you have your
code on the wrong button? Maybe the button has a weird hit state?

The other thing is, fscommand() mainly works in Projectors, yet you've
got something special going on. You said your SWF is "running in a
screensaver," so that may be introducing an unforeseen twist. Are you using
3rd party softare to create your screensaver? Most screensavers quit when
the mouse moves at all, or when someone touches the keyboard, not when
someone clicks on a button, so I'm having a hard time visualizing your
project.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Re: "ESC" button? Ronak Bhagdev
12/23/2004 2:45:08 PM
Hi,
I think u want a script such as when u click ESC button on keyboard u will
quit from application.

If yes than this is the script

onClipEvent (keyUp)
{
if (Key.getCode() == Key.ESCAPE)
{
fscommand("quit");
}
}Q]


Regards,
Ronak
Re: "ESC" button? Maddug
12/23/2004 7:50:02 PM
OK, if I view my SWF, not Projector, and click on my "close" button, it closes
the SWF. The screensaver program I'm using is GlobFX's Swiff Saver. It takes
SWF files and exports them as .SCR (screen saver file). So when the screen
saver is playing I've set it so you can still use the mouse without exiting the
saver. You can hit the ESC key on the keyboard and it exits fine, but clicking
my "close" button in the movie doesn't work. For some reason it's not passing
on the close command from the SWF throught the Screen Saver file.
AddThis Social Bookmark Button