Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Im creating an iPhone game with Adobe AIR, and I want to be able to load a simple text msg into an dynamic text box on the games front screen from my server (and then be able to update that text file on the server, so it updates automatically in the game after the game is on the app store) How would I go about acheiving that? is it as simple as using a getURL? are there any specifical issues with trying to do this on the iPhone via AIR that I should be aware of?

Thanks for any advice.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You could just use an URLLoader as you would with a classic flash application.

Something like that:

var request:URLRequest = new URLRequest("url to load");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, 
    function(event:Event)
    {
        _myTextField.text = URLLoader(event.target).data as String
    }
);

There's no restriction on iOS regarding loading external URLs (as long as you ain't loading and interpreting code), but you should check if your user has an internet connection before trying to load the URL and handle it. You might also want to cache the returned file.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.