Getting Stage3D to work on iPhone, with AIR 3.2 and Flashdevelop

That screenshot above is an important test project – I finally got stage3D working on iPhone! Which means, hopefully, I’m one step closer to getting Super Hexagon working on iPhone. Which is not necessarily where I want the game to end up, but I figured (since it’s supposed to be technically possible with flash now), it would be fun to at least try it and find out how it feels.

Anyway, getting Stage3D to work on an iPhone took a LOT of messing around, more than these sorta things usually take, and I had a lot of trouble finding recent information online on how to do it – so, I’m going to be a good interneter, and write a short tutorial, for future googlers who might have to go through this horrible process. Here goes:

I’m using FlashDevelop 4.0.4 RTM on windows, and I’m compiling with AIR version 3.2. All of the following assumes that you’ve already got a basic flash project working on an iPhone. If you haven’t, this isn’t the right tutorial for you. (try this one!).

Stage 3D doesn’t work with AIR 3.1, and I wasn’t able to get it to work with 3.3. If you don’t have AIR 3.2, you should be able to get it by just reinstalling the latest version of FlashDevelop. So, set your projec to target AIR Movile 3.2 under Project -> Properties -> Platform.

Next: this is the bit that tripped me up for a while: there’s an application.xml file in the root directory of your project. At the top of this there’s anoter line to select your version of AIR. Make sure that’s also set to 3.2, like this:

<application xmlns=”http://ns.adobe.com/air/application/3.2″>

Next, for Stage3D to work, you need to pass an additional compiler option. Under Project -> Properties -> Compiler Options, add the following under “Advanced Compiler Options”: “-swf-version=13″.

Under Project -> AIR App Properties -> Initial Window -> Non-Windowed Platforms, set the Render Mode to “Direct” (NOT GPU, like you might assume).

Once you’ve done that, the final bit is to edit application.xml again. There are a bunch of settings under “initial window” here – add the following to this:

<depthAndStencil>true</depthAndStencil>

That should be everything! Good luck!

* 10 Comments

10 Comments so far

  1. synkarius on July 9th, 2012

    That’s fantastic. Thanks for the tutorial. I’ll try this right away. :)

  2. Jaymz on July 9th, 2012

    Consider at least one copy of Super Hexagon for iPhone already downloaded with a five star rating!

  3. Derek on July 9th, 2012

    What iPhone? 3GS or 3G?

  4. Alcatraz968 on July 9th, 2012

    That cool, But finish on the computer first, im dying to play Super Hexagon.

  5. Liam on July 9th, 2012

    Nice work – and so glad you’re using FlashDevelop too.

  6. David on July 13th, 2012

    yea its a pain took me a while to figure out why stage3d wasn’t working or working as i wanted.

  7. [...] Getting Stage3D To Work On IPhone, With AIR 3.2 And Flashdevelop (distractionware: devlog) “Anyway, getting Stage3D to work on an iPhone took a LOT of messing around, more than these sorta things usually take, and I had a lot of trouble finding recent information online on how to do it – so, I’m going to be a good interneter, and write a short tutorial, for future googlers who might have to go through this horrible process. Here goes:” [...]

  8. RyanHuggins on August 3rd, 2012

    My question is all about performance now? How does it perform on the iPhone?

  9. Hector on October 9th, 2012

    Hey dude, i can’t stop to play this game, sometimes i hate you by that. I can describe it like a Tetris successor, almost addictive.
    ¡Greetings from México!
    Juego Chingón.

  10. [...] Getting Stage3D To Work On IPhone, With AIR 3.2 And Flashdevelop [...]

Leave a reply

The sausage champs webring!
previous site | random site | next site