Diddy's LaunchBrowser function under flash

Monkey Targets Forums/Flash/Diddy's LaunchBrowser function under flash

silentshark(Posted 2013) [#1]
Hi all,

anyone else had any issues with the LaunchBrowser function and Flash? This is with Monkey 70c..

All ok on other platforms (HTML5, iOS, Android), but for me LaunchBrowser causes the app to hang when called in Flash - on Chrome (28) and IE10.


therevills(Posted 2013) [#2]
I'll have a look tonight, but all what Diddy is doing is calling the internal Flash function "navigateToURL":

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/package.html#navigateToURL%28%29

        static public function launchBrowser(address:String, windowName:String):void
        {
                var adobeURL:URLRequest = new URLRequest(address);
                navigateToURL(adobeURL, windowName);
        }



therevills(Posted 2013) [#3]
Just tested on v72b using IE10, Chrome28 and FF18, all works fine here...

I'm just doing the following:
		If KeyHit(KEY_F1)
			LaunchBrowser("http://www.google.com")
		End


How are you calling it?


silentshark(Posted 2013) [#4]
Hi! Thanks for taking a look.

I'm using a line like the following:

LaunchBrowser ("http://www.google.com", False)


Seems fine on iOs, Android, HTML, but hangs on Flash..


therevills(Posted 2013) [#5]
Ah so you want the current window to go to your site, can you try True instead of False please?


therevills(Posted 2013) [#6]
Just tested, works fine here with the False flag...


silentshark(Posted 2013) [#7]
I will give the True flag a whirl. Interesting the False flag works for you..

Maybe it's something else in my environment? version of Monkey/ version of Diddy/ version of Flex etc. etc.


CGV(Posted 2013) [#8]
I tested it in Flash, HTML5, GLFW and Android. Both True and False work for me as well. It may just be your box.


silentshark(Posted 2013) [#9]
Many thanks for the replies, guys.

I've done some more digging, and there's more to it than I thought.

1. If I compile and run my program (into Flash) from the Monkey IDE, LaunchBrowser works fine.
2. If I browse to the flash folder in the build folder, and double-click on MonkeyGame.swf, LaunchBrowser works fine.
3. If I browse to the flash folder in the build folder, and double-click on MonkeyGame.html, then I see the freezing problem with LaunchBrowser (on two different computers).

weird.


therevills(Posted 2013) [#10]
The HTML actually has to be served via a Webserver, its should be the same for a HTML5 Monkey game too.