Skip to main content
Participating Frequently
March 6, 2013
Question

iOS app worked in AIR3.4 but wont load .as classes in AIR 3.5 (on device)

  • March 6, 2013
  • 13 replies
  • 1684 views

Okay so im developing a game for both Android and iOS. I was using AIR 3.4 for the development, and the app worked no problem on both platforms. However now that I have updated it to 3.5 (also tried 3.6 but the same issue arises) the app works on Desktop and Android, but when installed on my iPad it launches the app, but seemingly doesnt load any of the class files (not even the document class). It hasnt frozen because i've tested it using a simple animation on the main timeline which plays when the app is opened. Anybody else encountered this problem or something similar that may help me solve my problem?

Thanks,

Sam

This topic has been closed for replies.

13 replies

Participating Frequently
March 16, 2013

Hi sammcgarry13,

Could you please test the issue with AIR 3.7, we fixed a similar issue in AIR 3.7

AIR 3.7 build is available at http://labs.adobe.com/downloads/air.html.

Please let us know if the issue still exists .

Thanks

-Ankur

Participant
March 18, 2013

This worked for me Ankur so thanks for the update.

Out of interest, you said you have fixed this in 3.7 - is there a workaround to get this working in 3.5/3.6?

I haven't looked at the roadmap in a while, do you have an estimated timeframe for when 3.7 will be out of beta?

Ryan

Participating Frequently
March 18, 2013

Hi thisisryan83,

Sorry to inform but there is no fix/workaround available in 3.5/3.6 .

Regards,

-Ankur

Participant
March 14, 2013

I'm having similar issues as described above.

Switching environment from 3.4 to 3.5/3.6 stops app working in iOS (works fine when previewing from CS6). Code is simple, root timeline instantiates a main class ( var main:Main = new Main(this); ) and inside that class I'm setting textfield copy in the constructor method (_timeline.tmp.text = "HELLO").

The above doesn't work when converting a file from 3.4, but if I was to start a file from scratch and set it to 3.6 then it seems to work fine on the above basic example.

It doesn't seem to be the application.xml as all seems to be edited as expected.

Possibly solution found here, but didn't work for me: http://curtismorley.com/2013/03/05/app-used-to-work-with-air-3-2-or-3-4-doesnt-work-with-air-3-5-or-3-6/

Any ideas appreciated

Ryan

Participating Frequently
March 14, 2013

The solution that I found to my issue was that I had a public static var music:MusicController = new MusicController(); which for some reason 3.5 upward didn't like so wouldn't launch. The way I fixed it was to simply remove the static from my variable. Maybe try putting your Main as the document class rather than instanciating on the main timeline? Does that make any difference?

Participant
March 14, 2013

Will give it a shot in a bit, working on it now.

Seems strange that I have the exact same code in a new file that started as 3.6 and it works without the need of it being a document class.

If I find any other solution I'll let you know

Ryan

Participating Frequently
March 7, 2013

So further developments here... it's not working on iOS because I am instantiating the MusicController as a public static var in my document class: public static var music:MusicController = new MusicController();

Anybody encountered this before or know of a way around it?

Cheers!

Participating Frequently
March 8, 2013

Can you please provide me with a sample app along with sources  at ankbansa@adobe.com so that we can reproduce the issue  at our end ? You can share the app via dropbox so that attachments don't get blocked in the emails .

Thanks ,

Ankur

Participating Frequently
March 7, 2013

Okay so I've done a bit more digging and started rebuilding my app from scratch until I come across the problem again. And i've found the source... My music controller class. However I can't figure out why t doesnt work properly? anyone got any ideas why this class stops my app from launching on iOS devices?

MusicController.as

package  {

 

          import flash.media.*;

          import flash.display.MovieClip;

          import flash.events.*;

 

          public class MusicController extends MovieClip

          {

                    private var musicPaused:Boolean = false;

                    private var sndChannel:SoundChannel;

                    private var soundClip:Sound;

                    private var pausePosition:Number = 0;

                    private var volumeAdjust:SoundTransform;

                    public function MusicController()

                    {

                              addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);

                              addEventListener(Event.REMOVED_FROM_STAGE, onRemoveFromStage);

                    }

 

                    private function onAddedToStage(e:Event):void

                    {

                              //Create an instance of the Sound class

                              soundClip = new Song();

                              //Create a new SoundChannel Object

                              sndChannel = new SoundChannel();

                              volumeAdjust = new SoundTransform();

                    }

 

                    private function onRemoveFromStage(e:Event):void

                    {

                              removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);

                              removeEventListener(Event.REMOVED_FROM_STAGE, onRemoveFromStage);

                    }

 

                    //Plays the music

                    public function playMusic():void

                    {

                              if(Main.musicOn)

                              {

                                        sndChannel = soundClip.play(0, 999);

                              }

                    }

 

                    //Stops the music

                    public function stopMusic():void

                    {

                              if(Main.musicOn)

                              {

                                        sndChannel.stop();

                              }

                    }

                    //Pauses the music

                    public function pauseMusic():void

                    {

                              if(Main.musicOn)

                              {

                                        var lastPosition:Number = sndChannel.position;

                                        sndChannel.stop();

                                        pausePosition = lastPosition;

                              }

                    }

 

                    //unPauses the music

                    public function unpauseMusic():void

                    {

                              if(Main.musicOn)

                              {

                                        sndChannel = soundClip.play(pausePosition);

                              }

                    }

 

                    //Lower the volume of the music

                    public function lowerMusic():void

                    {

                              if(Main.musicOn)

                              {

                                        volumeAdjust.volume = .3;

                                        sndChannel.soundTransform = volumeAdjust;

                              }

                    }

          }

 

}


Colin Holgate
Inspiring
March 7, 2013

What is Song()?

Participating Frequently
March 7, 2013

It's a .mp3 in my library that has been exported for actionScript with the Class: Song and Base Class: flash.media.Sound

natural_criticB837
Legend
March 7, 2013

Have you updated the air version in the application.xml as well? In FlashDevelop I have to set it both in the project and in the xml.

Participating Frequently
March 7, 2013

Thanks portergeist_, but i've tried checking that, and it has changed to 3.5 and 3.6 as expected when I have tried either of them.