1

i have an exe file of a game made in construct2 tool..i am trying to run it from my as3 code using url requset..but my code is not working what should i do? here is my code..

  btn1.addEventListener(MouseEvent.CLICK, f_testURLOpener);

function f_testURLOpener(event:MouseEvent):void
{
 var url:String = "UserGuide/carrace(banjonborno).exe";
var request:URLRequest=new URLRequest(url);
navigateToURL(request);
}

when i click btn 1 to run the game it is showing the programm's publisher could not be verified.. are construct 2 made exe files not runnable from as3?

USERRR5
  • 430
  • 2
  • 10
  • 27

2 Answers2

1
  1. You cannot run .exe in Web apps (flash/Actionscript)

  2. You could use Adobe Air desktop app to run a process on the local machine http://help.adobe.com/en_US/air/html/dev/WSb2ba3b1aad8a27b060d22f991220f00ad8a-8000.html

Adrian Pirvulescu
  • 4,308
  • 3
  • 30
  • 47
  • I followed your instruction exactly same as u told ..but two errors are showing up why is this happening....Scene 1, Layer 'Layer 1', Frame 1, Line 6 1046: Type was not found or was not a compile-time constant: File. Scene 1, Layer 'Layer 1', Frame 1, Line 6 1120: Access of undefined property File. – USERRR5 Mar 01 '15 at 06:01
1

Considering that you have a Desktop application using Adobe AIR, not a Flash Player based application running on browser.

You can try the method openWithDefaultApplication

var file:File = File.applicationStorageDirectory.resolvePath('UserGuide/carrace(banjonborno).exe');

trace('file?', file.exists);

if (file.exists) file.openWithDefaultApplication();
gabriel
  • 2,351
  • 4
  • 20
  • 23
  • i am working on your idea my updated code is import flash.filesystem.File; import flash.net.FileFilter; btn1.buttonMode=true; btn1.addEventListener(MouseEvent.CLICK, f_testURLOpener); function f_testURLOpener(event:MouseEvent):void { var file:File = File.applicationStorageDirectory.resolvePath('UserGuide/carrace(banjonborno).exe'); trace('file?', file.exists); file.openWithDefaultApplication(); } an error showing.... file or directory access denied..... why is this showing – USERRR5 Mar 02 '15 at 02:41
  • http://www.filedropper.com/linkgame_1 here is my fla file..i set up the target in setting AIR3.2 for Desktop ..why is my exe game file is not linking up with the as3 – USERRR5 Mar 02 '15 at 02:46
  • my game file (that i want to load from external folder)is not made in flash platform it is an exe file of another platform...what might be the cause of this error "file or directory access denied" i thought openWithDefaultApplication(); would work but not working :( where pdf files loading is not creating problem – USERRR5 Mar 02 '15 at 06:07
  • I believe will be necessary to dig more into your problems, sorry for not being able to help. – gabriel Mar 02 '15 at 07:13