February 28, 2012 - 17 comments

Starling, AS3, Flash, Stage3D on iPad Demo

So, with the release of Air 3.2 this week I decided to run a quick demo in the iPad using the source code of the Whack Game Demo by Byxb Interactive. This is pretty easily to do - overlay the Air 3.2 SDK then just create a new mobile project and copy over the source from the project.


I couldn't get it to run at the full 60fps of the original demo but it quite happily plays along at 30fps.

Big Up to Byxb Interactive for releasing the code!

Whack Game Tutorial and Source Code
Air 3.2 Release Candidate

Update

Be sure to check out these links also to help debug any issues you may run into...

Air 3.2 Fp11 p6 Release Notes
Some Basic IOS Deploy Tips

Published by: nick in AS3, Code Sample, Flash, Flex, IOS/ XCode, Mobile

Comments

miha
February 28, 2012 at 7:20 am

Hi! I was thinking of doing exactly what you did. Is this iPad I or II?

    admin
    February 28, 2012 at 7:23 am

    This is on an iPad 2 – make sure you export as a release build – otherwise you’ll notice it running slightly slower

jmp909
March 7, 2012 at 7:40 am

Hi,

how did you set your resolution settings. I only got 11FPS on ipad 2, both within the app properties and embed tag? maybe because i’ve got more of the screen displaying than needs to.

thanks
j

    admin
    March 7, 2012 at 7:51 am

    I literally just copied it over from the source code and changed the SWF size using the SWF Meta Data tag – I also made a small change to the Starling startup – setting a rectangle to the size of the stage

    [SWF(frameRate="60", width="800", height="550")]

    _starling = new Starling(Game, stage, new Rectangle(0,0,800, 450) );

    That frame rate does seem very low though so I would check against the compiler – make sure you’re compiling for FP15 in your compile settings. Also “embed tags” – not sure how this is related as we’re not embedding a SWF?

jmp909
March 7, 2012 at 7:56 am

anything wrong here…? that’s the only other place where settings might be an issue

I do have additional compiler options in FlashDevelop set as -swf-version=15

<![CDATA[ …
UIDeviceFamily


2

high

WhackAS3
WhackAS3.swf
true
false
false
landscape
direct

thanks
j

jmp909
March 7, 2012 at 7:58 am

ah.. thought that might happen..

infoAdditions:
key: UIDeviceFamily, array: string -> 2
requestedDisplayResolution: high

initialWindow:
visible: true
fullScreen: false
autoOrients: false
aspectRatio: landscape
renderMode: direct

jmp909
March 7, 2012 at 7:58 am

by embed tags i meant the swf meta tags, sorry

admin
March 7, 2012 at 8:06 am

Haha no worries – you had me worried on the embed tags… The rest looks fine to me – might be worth trying that Sparrow view port argument in the constructor – see how you go. Everything else looks fine – but in all fairness I haven’t used Flash Develop in a little while, I recommend taking a look around though – I know in conversations I’ve had with people it hasn’t been as easy as expected. Another big thing to look for is that you aren’t using the traditional display list – i.e. overlaying buttons or views over the Stage3D view – this is something Terry Paton made a point of mentioning when we spoke.

jmp909
March 7, 2012 at 8:08 am

i’m just compiling Whack source directly with the 2 changes you suggested to reduce the viewport.

using either Open Source Flex 4.6 and Adobe Flex 4.6

set FLEX_SDK=C:_DEV_AS3_sdkflex_sdk_4.6+air3-2_p6_sdk_win_022712
::set FLEX_SDK=C:_DEV_AS3_sdkflex_sdk_4.6.0.23201_mpl+air3-2_p6_sdk_win_022712

jmp909
March 7, 2012 at 8:47 am

was your memory growing constantly on the menu screen?

    Nick
    March 7, 2012 at 8:57 am

    I hadn’t actually noticed as it was just a quick test I ran – looking at it now though it’s definitely rising slowly but then its dropping – it’s more likely just Starling firing up. Think the best way would be to build something for yourself with best practice in place – then you can appreciate everything as you add in more functionality. I’m aiming to do some more tests in the coming week or so once I get some free time so will post my findings.

jmp909
March 7, 2012 at 9:03 am

that would be the next step, i was just wondering why my build (which should essentially be the same as yours) was such a low frame rate. dont know if it’s down to the version of the SDKs, or the FD compiler etc.

Will report back if i find anything
thanks
j

Nick
March 7, 2012 at 9:13 am

Also – make sure you’re using the latest releases of Starling 😉

jmp909
March 7, 2012 at 9:32 am

tried putting the latest starling into the latest whack off github and started getting errors.

the latest starling seems to have slightly different functions so there are some invalid overrides etc

Nick
March 7, 2012 at 9:36 am

Try working through the errors – I updated to the latest one after my early tests and it was pretty straight forward to up.

jmp909
March 7, 2012 at 9:51 am

i think we’re working with different versions. i’m getting errors eg

C:UsersjDesktopAirMobileWhackAS3srccombyxbextensionsstarlingdisplayDrawImage.as(171): col: 31 Error: Method marked override must override another method.

protected override function createVertexBuffer():void

but that function doesn’t exist in the superclass starling.display.Image; or it’s superclass starling.display.Quad

please could you advise me to the version numbers you’re using?

thanks
j

jmp909
March 9, 2012 at 5:20 pm

turns out the default packaging was using interpreter mode (i was running run.bat rather than packager.bat in FladhDevelop). getting it packaged with ipa-test or ipa-debug worked much better. still need to fix Starling version issues, but that’s a separate matter. Starts dropping from 30 to 18fps as the mole tunnels down, but it’s closer to your results now anyway

thanks
j

Leave a Reply to admin Cancel Reply