Highlighted

Exit button for .swf or projector?

New Here ,
Nov 04, 2011

Copy link to clipboard

Copied

Hi All,

I am admittedly a complete novice, so please bear with...just completed Lynda tutorial on Flash Pro cs5.

Just trying to do a simple animation with an exit button to close out the player (projector, Flash Player). I have seen several discussions on the same, and have tried all example code to no avail. I am testing through publishing, not preview and it does not function as an exit button.

Have tried:

on(release){

fscommand("quit");

}

...and...

import flash.events.MouseEvent;

exitButton_mc
.addEventListener(MouseEvent.CLICK, function()
{
        fscommand
("quit");
}

I created the button symbol, selected it and then selected the first keyframe on that layer...entered AS3 window and tried the above code. No luck : /

Any help would be greatly appreciated! I searched through the forum and was unable to locate the answer to this question. Apologies if I missed it somehow.

Thanks in advance!!!

Sorry, I thought I saved it as CS4.. anyway, I uploaded a CS5 version now. Try downloading it again.

TOPICS
ActionScript

Views

26.1K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Exit button for .swf or projector?

New Here ,
Nov 04, 2011

Copy link to clipboard

Copied

Hi All,

I am admittedly a complete novice, so please bear with...just completed Lynda tutorial on Flash Pro cs5.

Just trying to do a simple animation with an exit button to close out the player (projector, Flash Player). I have seen several discussions on the same, and have tried all example code to no avail. I am testing through publishing, not preview and it does not function as an exit button.

Have tried:

on(release){

fscommand("quit");

}

...and...

import flash.events.MouseEvent;

exitButton_mc
.addEventListener(MouseEvent.CLICK, function()
{
        fscommand
("quit");
}

I created the button symbol, selected it and then selected the first keyframe on that layer...entered AS3 window and tried the above code. No luck : /

Any help would be greatly appreciated! I searched through the forum and was unable to locate the answer to this question. Apologies if I missed it somehow.

Thanks in advance!!!

Sorry, I thought I saved it as CS4.. anyway, I uploaded a CS5 version now. Try downloading it again.

TOPICS
ActionScript

Views

26.1K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 04, 2011 0
Enthusiast ,
Nov 04, 2011

Copy link to clipboard

Copied

I created an example which works just fine. You can download it here: http://dev.flashlabs.eu/examples/fscommand/source.zip

The source looks like this:

import flash.display.StageScaleMode;

stage.scaleMode = StageScaleMode.NO_SCALE;

btn_exit.addEventListener(MouseEvent.CLICK, exitBtn_clickHandler);

function exitBtn_clickHandler(event:MouseEvent):void {

    fscommand("quit");

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 04, 2011 1
New Here ,
Nov 04, 2011

Copy link to clipboard

Copied

Thanks Peter, is there any way you could send me a legacy cs5 version of your example? I don't have 5.5 as of yet and connot view : /

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 04, 2011 0
Enthusiast ,
Nov 04, 2011

Copy link to clipboard

Copied

Sorry, I thought I saved it as CS4.. anyway, I uploaded a CS5 version now. Try downloading it again.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 04, 2011 1
New Here ,
Nov 04, 2011

Copy link to clipboard

Copied

FAN-FREAKIN'-TASITC! Thanks Peter!!! Works beautifully, thanks so much!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 04, 2011 0
Enthusiast ,
Nov 04, 2011

Copy link to clipboard

Copied

You're wellcome.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 04, 2011 0
Participant ,
Jul 30, 2012

Copy link to clipboard

Copied

Hi,

I want to know the swf can call fscommand too.

I know projector file can call .bat/.exe but it is not working with swf in browser as well as standalone.

Thanks

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 30, 2012 0
New Here ,
Nov 20, 2014

Copy link to clipboard

Copied

Hey.. It really works...thanks for the gunshot post....

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 20, 2014 0
New Here ,
Feb 16, 2020

Copy link to clipboard

Copied

cant. i know exit coding for adobe animate actionscript 3.0?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 16, 2020 0