Copy link to clipboard
Copied
Hello,
We have a game that we are developing for tablets that we are porting over from a browser based Flash game. In that game, there is a link to a PHP script that loads in player information and displays it on a web page. We would like to be able to reuse this functionality without having to rebuild it all in Flash for AIR. I know that AIR has Webkit support built in but I'm having a hell of a time finding out if it can display a web page from inside the application, rendered with PHP. Also I'm having trouble finding any information on how to actually use Webkit inside of AIR, other than an old mx:HTML component. Any help on this would be much appreciated.
Copy link to clipboard
Copied
While it is possible to serve local html files to an instance of a StageWebView, it is not running as a server. Thus, your PHP code will NOT execute. You can display the html that lives on your server, since you are haing the user sign, some form of network access is need. You could look at using the SQLite DB to save the user information, so you could enable offline playability, then sync the data once there is a connection.
Here is something I wrote on using SWV and Google Maps. Maybe you can find it useful: http://chrisgriffith.wordpress.com/2011/01/04/integrating-maps-into-your-mobile-application/
Good luck,
Chris Griffith
Copy link to clipboard
Copied
Thanks. I think I just had a brainfart. Obviously if AIR can read in HTML it can call a PHP file on a server and read in the HTML it generates. My question now is that the component it uses to do this is <mx:HTML>. I know that a lot of the old mx components don't work in mobile AIR development. Will this one? I'm assuming it must since it's the only one of its kind.
Copy link to clipboard
Copied
Here is a sample of SWV & Flex:
http://cookbooks.adobe.com/post_Create_a_basic_web_browser_with_StageWebView-18850.html
I use with my several of my mobile apps that I have built.
Chris
Find more inspiration, events, and resources on the new Adobe Community
Explore Now