1 Replies - 3840 Views - Last Post: 04 April 2014 - 02:07 AM

#1 kanika aneja  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-April 14

Exit button in adobe flash CS6,actionscript 2

Posted 04 April 2014 - 12:03 AM

Hi all

i have been trying this exit button from long ,its not working with actionscript
 import flash.display.StageScaleMode;
 
stage.scaleMode = StageScaleMode.NO_SCALE;
 
btn_exit.addEventListener(MouseEvent.CLICK, exitBtn_clickHandler);
 
function exitBtn_clickHandler(event:MouseEvent):void {
    fscommand("quit");
}
and
on (release)
{
	fscommand("quit");
	getURL ("javascript:window.opener=self;window.close()" ); 
}


Please suggest me

This post has been edited by Atli: 04 April 2014 - 01:25 AM
Reason for edit:: Use [code] tags when posting code.


Is This A Good Question/Topic? 0
  • +

Replies To: Exit button in adobe flash CS6,actionscript 2

#2 ge∅  Icon User is offline

  • D.I.C Addict

Reputation: 80
  • View blog
  • Posts: 564
  • Joined: 21-November 13

Re: Exit button in adobe flash CS6,actionscript 2

Posted 04 April 2014 - 02:07 AM

If y remember well, fscommand won't work if you test it within the application. You have to test it in the browser's environment (double-clicking on the .swf might work as well).

getURL shouldn't be necessary, but if you need to run some javascript, it is best to use the flash.external.ExternalInterface API instead of the old javascript: "protocol".
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1