32 Replies Latest reply on Mar 1, 2012 2:57 AM by madhu_51

    Problem with Flex mobile app on iOS

    miguel.martin

      Hello there, I got an application, which reproduces video using osmf, working quite well with debug and run versions on iOS and Android platforms. It also works without any further problem when I export a release build for Android.

       

      The problem is that the very same application does not work when I export it for iOS. I'm using Flash Builder 4.5.1 and I package it using a distribution cert and a distribution provisioning file, selecting ad hoc packaging for testing it before I could submit it to the App Store.

       

      The distribution cert and distribution provisioning files seem to be ok: I've checked the profiles installed on my ipad2 and it's been installed without problems and it's valid for a year.

       

      The application freezes and become unresponsive when I try to log in into it (just a few HttpService invocations), and then, after some minutes it closes itself, like some kind of memory issue (remember that it works with run/debug versions).

       

      Is there anything I can check or be aware of when exporting an app for the iOS platform? I'm not receiving any kind of errors and I'm trying to disable parts to see what it's causing this problem, but as you can imagine, it's a very tedious process since packaging for iOS takes several minutes.

       

      Any ideas that could accelerate this process and know what it's happening?

       

      Thanks in advance.

        • 1. Re: Problem with Flex mobile app on iOS
          Shongrunden Adobe Employee

          Does it work if you use fast mode to package for iOS?

          • 2. Re: Problem with Flex mobile app on iOS
            miguel.martin Level 1

            It works for run/debug using fast and standard packaging. However it does not work when exporting it as a release build for iOS (for Android it does work).

             

            Thanks for your reply.

            • 3. Re: Problem with Flex mobile app on iOS
              Shongrunden Adobe Employee

              My first thought is that maybe you're trying to load an external SWF, but that shouldn't work in standard packaging mode.

              • 4. Re: Problem with Flex mobile app on iOS
                miguel.martin Level 1

                I'm not loading any external SWF, the only think about this application is that it needs other projects (it is not a single project, it's a project consisting on different ones: model, skins, libraries, etc) and sometimes It has to make multiple server requests (N httpservices at the same time).

                • 5. Re: Problem with Flex mobile app on iOS
                  Shongrunden Adobe Employee

                  Multiple projects, but they all get compiled into one IPA right?

                  • 6. Re: Problem with Flex mobile app on iOS
                    miguel.martin Level 1

                    Right. It's something like there's some logic or process that works on run/debug versions but don't on release ones. I've tried commenting out code and I was able to enter the application normally. The problem is that the application is doing simple tasks on load. I can't understand why the release version is not working, it's only a couple of ChangeWatchers to register a couple of handlers on properties change. These Change Watchers are responsible of processing of various XMLs which contains just a few nodes.

                    • 7. Re: Problem with Flex mobile app on iOS
                      Shongrunden Adobe Employee

                      Are you able to file a bug with your project?

                      • 8. Re: Problem with Flex mobile app on iOS
                        jd.perez-diaz

                        Miguel:

                         

                        Did you ever find out what was wrong. I am having a similar issue. My app works well in debug, but then I repackage using ad hoc and it breaks after a certain point.

                        • 9. Re: Problem with Flex mobile app on iOS
                          miguel.martin Level 1

                          @jd.perez-diaz: I did find the issue that kept my app from working. It was related with some static functions (generic collections treatment) that I've got coded in a utility class. Removing the code where I was calling these static functions and coding my desire functionality inside the proper .as and mxmls, I was able to solve the problem.

                           

                          However I've not found the time to extract the concrete problem and file a bug for it.

                           

                          Hope it gives you some clue. It's so annoying to find what's going on considering that each release takes aprox 10 minutes.

                          • 10. Re: Problem with Flex mobile app on iOS
                            alinator11 Level 2

                            I have this same problem. I can deploy with developer cert to registered devices if I use the lowest level (fastest) compile but when I got a distribution cert and tried to package for dist, all I ever got was failures. In any scenario other than the fastest compile for device testing with a developer cert, the ipa gets built, deployed and looks like it will install. Then it fails with no message.

                            • 11. Re: Problem with Flex mobile app on iOS
                              Shongrunden Adobe Employee

                              Fast packaging is extremely different than standard packaging.  If you are able to debug with fast mode can you try debugging with standard mode and see if that works?

                              • 12. Re: Problem with Flex mobile app on iOS
                                alinator11 Level 2

                                I just ran standard and the result was that the app packaged, downloaded and installed correctly. The giant but is that while I had sound, I had no screen and thus no useful program.

                                 

                                When I package in fast mode, the app performs well and I have a visible screen.

                                • 13. Re: Problem with Flex mobile app on iOS
                                  Shongrunden Adobe Employee

                                  It's possible that you are using a feature that isn't supported on iOS.  Can you provide a small sample application that demonstrates this?

                                  • 14. Re: Problem with Flex mobile app on iOS
                                    alinator11 Level 2

                                    I would be happy to provide you a running version of the app, one for Android and one for iOS so you can compare the differences and actually run the Android version to see what the iOS version should do. Please let me know if you'd like me to do this as that's the best sample program I can give you.

                                     

                                    Also, I don't see how an iOS packing can result in a properly running application in fast packing mode but a failure in the other and it be due to some unsuported feature on iOS. The app is running on iOS with fast packaging but failing with the other packaging. It would seem the iOS version should not work at all if it's some unsupported iOS feature causing the problem...

                                    • 15. Re: Problem with Flex mobile app on iOS
                                      Shongrunden Adobe Employee

                                      I'm looking for a small, complete, compilable sample application that I can build locally to try and reproduce the issue.  For example this thread has a great example of a small, complete, compilable sample application: http://forums.adobe.com/message/3896669#3896669

                                       

                                      Fast packaging doesn't cross-compile the runtime and application down into native ARM code.  Instead it just bundles the AIR runtime and interprets the application at runtime (just like AIR typically operates on other devices).  But loading and interpreting code at runtime is strictly forbidden by Apple's iOS terms of service.  So while it's fast mode is nice to do quick debugging with locally, it isn't something that would be accepted if you were to submit it to the App store.

                                       

                                      Standard packaging cross-compiles the runtime and application together into native ARM code so there is no runtime loading and interpreting of code.  This packaging process can take a while so that is why there is an option for fast package if you just want to quickly iterate on something like laying out elements of your application. This video might be useful: http://www.youtube.com/watch?v=7moxc_Zk4jE

                                       

                                      It's possible that your case should work in both modes, but there is a bug in the standard packaging, but we need to see some code to investigate further.

                                      • 16. Re: Problem with Flex mobile app on iOS
                                        alinator11 Level 2

                                        My problem is that my app is all swf loaded into flex using SWFLoader and embedded in the app. I have no idea how to determine what SWF is causing the problem (if it is an SWF causing the problem). However, if it helps, I can send you the SWF I'm embedding as well as the intro view of my app.

                                         

                                        Here is the view of my app:

                                         

                                        <?xml version="1.0" encoding="utf-8"?>

                                        <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                xmlns:s="library://ns.adobe.com/flex/spark" actionBarVisible="false" addedToStage="{initLoader()}"        

                                                 >   

                                            <fx:Script>

                                                <![CDATA[           

                                                    import mx.core.IVisualElement;

                                                    import mx.events.FlexEvent;

                                         

                                                    import spark.managers.PersistenceManager;

                                                    private var versionNumber:String = "1.4.14666";

                                         

                                                    private var pm:PersistenceManager

                                                    private function initLoader():void {

                                                        var t:Timer = new Timer(30000);

                                                        t.start();

                                                        t.addEventListener(TimerEvent.TIMER, timesUp);

                                                        pm = new PersistenceManager();

                                                        pm.load();

                                                        //if the version number does not match the version number hard coded in the

                                                        //code above, the system will clear the data. This is useful for testing where

                                                        //you want to force the app to clear user data so user has to go back through the

                                                        //sign up flow.

                                                        if(pm.getProperty("versionnum") == null) {

                                                            pm.clear();

                                                            pm.setProperty("versionnum", versionNumber);

                                                            pm.save();

                                                        }

                                                        else {

                                                            if(pm.getProperty("versionnum") != versionNumber) {

                                                                pm.clear();

                                                                pm.setProperty("versionnum", versionNumber);

                                                                pm.save();

                                                            }

                                                        }

                                                        pm.setProperty("enemyinit", "true");

                                                        pm.save();

                                                        splashVidLoader.removeEventListener(FlexEvent.CREATION_COMPLETE, initLoader);

                                                        splashVidLoader.content.addEventListener(Event.ADDED, onLoadSWF);

                                                    }

                                         

                                                    private function timesUp(timerEvent:TimerEvent):void {

                                                        mainMovie.stop();

                                                    }

                                         

                                                    private var mainMovie:MovieClip;

                                                    private function onLoadSWF(event:Event):void {

                                                        event.target.removeEventListener(Event.ADDED, onLoadSWF);

                                                        if(event.target.name == "introScreenMain") {

                                                            mainMovie = MovieClip(event.target);

                                                        }

                                                        if(event.target.name == "playButton") {

                                                            event.target.addEventListener(MouseEvent.CLICK, buttonPressed);

                                                        }

                                                        else if(event.target.name == "instructionButton") {

                                                            event.target.addEventListener(MouseEvent.CLICK, buttonPressed);

                                                        }

                                                    }

                                         

                                                    private function buttonPressed(event:Event):void {

                                                        if(event.target.name == "playButton") {

                                                            if(pm.getProperty("facelearned") != null &&

                                                            pm.getProperty("facelearned") == "true") {

                                                                //play the game

                                                                mainMovie.stop();

                                                                mainMovie = null;

                                                                creditsLoader.unloadAndStop();                       

                                                                splashVidLoader.content.removeEventListener(Event.ADDED, onLoadSWF);

                                                                splashVidLoader.unloadAndStop(true);

                                                                navigator.replaceView(EnemyViewer);

                                                            }

                                                            else {

                                                                //user needs setup

                                                                mainMovie.stop();

                                                                splashVidLoader.removeEventListener(Event.ADDED_TO_STAGE, onLoadSWF);                   

                                                                splashVidLoader.endEffectsStarted();

                                                                splashVidLoader.unloadAndStop(true);

                                                                navigator.replaceView(NewCappa);

                                                            }

                                                        }

                                                        if(event.target.name == "instructionButton") {

                                                            creditsLoader.load();

                                                            creditsLoader.addEventListener(MouseEvent.CLICK, creditsClosed);

                                                            creditsLoader.visible = true;

                                                        }

                                                    }

                                         

                                                    private function creditsClosed(event:Event):void {

                                                        creditsLoader.visible = false;

                                                    }

                                                ]]>

                                            </fx:Script>

                                            <fx:Declarations>

                                                <!-- Place non-visual elements (e.g., services, value objects) here -->

                                            </fx:Declarations>   

                                            <s:SWFLoader

                                                id="splashVidLoader"

                                                x="0" y="0"

                                                width="100%" height="100%"

                                                scaleContent="true"

                                                source="@Embed('assets/Intro.swf')"

                                                autoLoad="true"

                                                creationComplete="{initLoader()}"

                                                />

                                            <s:SWFLoader

                                                id="creditsLoader"

                                                x="0" y="0"

                                                width="100%" height="100%"

                                                scaleContent="true"

                                                source="@Embed('assets/Credits.swf')"

                                                autoLoad="false"       

                                                />

                                            </s:Group>-->   

                                        </s:View>

                                         

                                        I will send you both SWF's referenced here as a private message.


                                        When I used fast packaging, the Intro SWF loads up, I see the screen, hear the sounds and the buttons in the SWF work. When I use standard packaging, the SWF loads and I hear sound, but don't get a screen.

                                        • 17. Re: Problem with Flex mobile app on iOS
                                          Dushyandh

                                          So is there any issue in dynamic code loading / compiling ! I'm findind possibilities to taylor my business requirement of having a mobile portal. Earlier I had been using Sencha with Cue - me for this. Is there a work around for this using flex ??

                                          • 18. Re: Problem with Flex mobile app on iOS
                                            alinator11 Level 2

                                            I did read that Flex cannot dynamically compile on iOS. iOS does not allow just in time compilation.

                                             

                                            In keeping with this, I embedded all SWF's in my app (as assets and use the SWFLoader) so I have no need for just in time compilation and Flex can precompile everything.

                                             

                                            I am a bit confused over a few issues though. For whatever reason, my app works in fast packaging but not in standard. I hear yesterday from Shongrunden that there are some iOS features that are not supported. I'm using the camera and my SWF's have some animation and I'm calling Blaze and getting Strings and other objects passed back and forth. While I understand that these features (compiling to iOS and Android) are new to Flex, if you're going to provide the convenience of fast packaging, also please make the app fail or throw warnings if it will not later also compile to standard packaging. By NOT doing this, it could waste developer's time as we spend a great deal of time writing software, specifically in Flex so as to avoid having to write for iOS and Android, to later find out that all our work is futile and we have to go develop in Objective C anyway.

                                             

                                            I am at the end of my app development. I have a perfectly working Android app and a semi-working iOS app and absolutely no answers as to why and want to go live. Is there anyone that can help me find out what is wrong and finally publish to iOS?

                                             

                                            FYI, fast packaging says only that the app may run slower than it will run if you use standard packaging. It does not say that your app may work in fast packaging but won't work when you get to actually deploying it.

                                             

                                            Can someone also please tell me what iOS features are not supported via Flex? I can't imagine that I've tried to do something that iOS does not support but I can't say as I have no idea what iOS does not support that Android does via Flex. If iOS does not support something, can Adobe make Flex work like every other programming language I've ever worked with and have the compiler complain/fail if a developer tries to do something that iOS does not support. The worst thing you can do is not complain and in fact give me a working IPA file that installs but won't run - with each one of them taking 10 minutes or more to build and deploy! Make it fail during compile (and give some clue why) if it's not going to work please.

                                            • 19. Re: Problem with Flex mobile app on iOS
                                              Shongrunden Adobe Employee

                                              Re: Unsupported features:

                                               

                                              When I mentioned that some features are not supported I was mainly talking about the restriction about dynamically loading and interpreting code.  It appears that this means loading SWFs (via SWFLoader or otherwise) regardless if they are embedded or not.

                                               

                                              It appears that when you embed a SWF it isn't cross compiled to ARM code, but rather just treated like any other embedded object like a JPG or PNG.

                                               

                                              For example, this really simple sample application:

                                               

                                              <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                             xmlns:s="library://ns.adobe.com/flex/spark">

                                                 

                                                  <s:SWFLoader source="@Embed('SWF.swf')" />

                                                 

                                              </s:Application>

                                               

                                              (See attached SWF.swf)

                                               

                                              There is a red circle that animates across the screen.  This animation is accomplished by writing a little ActionScript to move the circle on a timer interval.  In fast packaging mode the red circle animates across the screen, but in standard packaging mode the red circle doesn't move suggesting that no ActionScript is being executed.

                                               

                                              I'll check to see if this is expected or if this is a bug.

                                               

                                              Re: "if you're going to provide the convenience of fast packaging, also please make the app fail or throw warnings if it will not later also compile to standard packaging"

                                               

                                              Great point. I'll check to see if there are runtime bugs filed for this.

                                               

                                              Re: "FYI, fast packaging says only that the app may run slower than it will run if you use standard packaging. It does not say that your app may work in fast packaging but won't work when you get to actually deploying it."

                                               

                                              Another great point. I'll check with the Builder team to see if we can make that message more useful.

                                              • 20. Re: Problem with Flex mobile app on iOS
                                                alinator11 Level 2

                                                Thanks so much! So if the SWF's won't compile even as embedded SWF's, how can I rebuild my app so it will run? I would be happy to take all the SWF's and compile to ARM but then I have no idea how to tie these many SWF's to my Flex code as the only way I see to do it now is to use SWFLoader? I have the fla's given to me by my designer. How can I make those FLA's part of my larger Flex code and get them to compile so I can wrap this project up?

                                                 

                                                FYI, fast packaging is also not consistent among devices. On an iPod 4, I got the app to run in fast packing mode. On an iPhone 4 the app starts but buttons that should not be visible are visible and the app does not behave as it should. Perhaps it won't matter much longer as if I can get the SWF's to be part of my app it sounds like all problems go away.

                                                • 21. Re: Problem with Flex mobile app on iOS
                                                  alinator11 Level 2

                                                  I think I [may] have figured it out (sort of) but I still can't get it to run fully - although I have now successfully gotten the SWF's to deploy individually to iOS and run with standard packaging on... Can someone tell me what to change to make this work? Here are the steps I took.

                                                   

                                                  First I made a new project

                                                  1. Took the intro SWF and made a new Flex Mobile project with that SWF in the "bin-debug" folder.

                                                  2. Made an .AS file with the same name as the SWF in the "default" source folder.

                                                  3. Configured Intro-xml as a mobile app.

                                                  4. Tested and ran that with standard packaging to iOS.

                                                  5. Deployed to iPod and, for the first time, the SWF worked with standard packaging for deployment.

                                                   

                                                  Now I just need to understand how to practically instantiate the SWF's in my Flex code and I'm hopefully good to go. Here is how I tried to do that:

                                                   

                                                  Then I added to existing project

                                                  1. Took above SWF file and put it in my main project bin-debug folder

                                                  2. Took above .AS file and put it in my main project default folder

                                                  3. Took above app-xml and put it in my main project src folder (now I have multiple app-xml files, one for my main app and one for this new "Intro" app that I just created).

                                                  4. Now that this first (test) SWF has been added to my project, I modify a Flex object that was previously loading this SWF to now call the AS directly. Instead of SWFLoader.load(), now my view instantiates the AS associated with the SWF that is in the bin debug. In this case, I've called the SWF, XML and ActionScript class by the name "Intro" so I have Intro.SWF, Intro-xml and Intro.AS and all are in the same project as main.xml, main.swf and main.mxml.

                                                   

                                                  In step 4, I am trying to instantiate, from my view, the Intro SWF that is in my bin-debug file as follows (note that my SWF is a MovieClip so I cannot use addElement and have to use addChild())

                                                   


                                                  <s:Group id="vidGroup"


                                                  x="0" y="0"


                                                  width="100%" height="100%"


                                                  >


                                                  <mx:UIComponent id="vidcomp" x="0" y="0"






                                                  width="100%" height="100%"






                                                  creationComplete="{initLoader()}"/>

                                                  </s:Group>

                                                   

                                                  private function initLoader():void {

                                                                  var intro:Intro = new Intro();

                                                                  vidcomp.addChild(intro);

                                                  }

                                                   

                                                  While I was able to get the SWF to load on the device when I made it a stand alone project, I am not now able to get the SWF I have added to the bin-debug folder to instantiate and run when I try to call it as part of my larger app. Since I have now made the SWF part of my app directly, I'm sure I just need to understand the practicalities of how to instantiate it. Can someone please help me understand how to get the SWF that is in my bin-debug folder to have a reference that I can control.

                                                  • 22. Re: Problem with Flex mobile app on iOS
                                                    Flex harUI Adobe Employee

                                                    Actionscript in a loaded SWF cannot be executed.

                                                    • 23. Re: Problem with Flex mobile app on iOS
                                                      alinator11 Level 2

                                                      Is there any way to solve my problem or am I sol?

                                                      • 24. Re: Problem with Flex mobile app on iOS
                                                        alinator11 Level 2

                                                        Btw, I don't care about executing AS on the loaded swf so much as I care

                                                        about getting a reference to the movieclip that the swf contains. If I can

                                                        get to that, I'm good. Is there a way to do that?

                                                        • 25. Re: Problem with Flex mobile app on iOS
                                                          drkstr_1 Level 4

                                                          Turn your SWFs into libraries and import the assets that way.

                                                           

                                                          The packager must be able to pick up the class linkages in your SWF. This means they need to be embeded as "code" and not assets. That means .swc libraries.

                                                           

                                                          If you give more info on the nature of these SWFs, I may be able to suggest a specific strategy for the conversion process. Mainly, is this dynamic content or "application assets"?

                                                          • 26. Re: Problem with Flex mobile app on iOS
                                                            alinator11 Level 2

                                                            I will be back at my computer soon and will try to convert. This is my

                                                            first flash project. My swfs were all designed by my designer (he is

                                                            absolutely not a programmer). They are animations, buttons, forms... stuff

                                                            like that. I will do a google search to find out the means to turn to a

                                                            library and try that.

                                                            • 27. Re: Problem with Flex mobile app on iOS
                                                              alinator11 Level 2

                                                              drkstr_1, thanks so much for the offer to help. While I will search through the web to find an answer as well, if you can give me one walk through of turning an SWF into a library object that I can then call and manipulate, that would be most helpful and appreciated.

                                                               

                                                              I put up one SWF from my app here: http://64.68.163.33:8080/NewCappaNoGend.swf

                                                               

                                                              That will load it in your web browser. From that SWF, I need to get a reference to the buttons so I can listen to them, enable/disable them as well as turn them visible/not visible as needed and I need to get the name and email text information and populate some other image fields with jpg's I send from Blaze.

                                                               

                                                              The way I get reference in Flex to the fields in NewCappaNoGend.SWF now is as follows:

                                                               

                                                              1. SWFLoader.load(@Embedded...)

                                                              2. SWFLoader.content.addEventListener(Event.ADDED, objectLoaded);

                                                              3. Function objectLoaded checks for the event.target.name of the SWF component item as it is added to stage. If it is one of the instance names I know about in the SWF, I cast event.target to the proper object (such as a TextField) and then I can manipulate the SWF fields as needed.

                                                               

                                                              Clearly none of the above works in iOS.

                                                               

                                                              I will search for how to convert SWF to library and will post if I find a solution before you respond. Thanks so much for your help. Sincerely.

                                                               

                                                              EDIT: Just noticed that you said SWC, not SWF. Read SWF... Duh. Found good references for how to do this here: http://livedocs.adobe.com/flex/3/html/help.html?content=projects_7.html

                                                              • 28. Re: Problem with Flex mobile app on iOS
                                                                drkstr_1 Level 4

                                                                The challenge will be getting the code in the FLA to play nice as a library. It will most likely involve opening up each FLA given to you by the designer and creating a top level "entry point" class that you can import into your project.

                                                                 

                                                                I attached an example to show you what I mean. I can't figure out how to attach an example to show you what I mean, but...

                                                                 

                                                                 

                                                                 

                                                                package
                                                                {
                                                                          import fl.controls.Button;
                                                                          import flash.display.Sprite;
                                                                
                                                                          public class SWCTest extends Sprite
                                                                          {
                                                                                    public var buttonDisplay:Button;
                                                                          }
                                                                }
                                                                

                                                                 

                                                                What I did in the FLA is plop everything sitting on the stage (in my case, a button with an intance name buttonDisplay), then I converted it into a movie clip with the class reference SWCTest. You change change the publish settings to publish as an SWC library instead of a SWF.

                                                                 

                                                                You can then use this class directly by importing the SWC into your Flex project, and then doing something similar to this:

                                                                 

                                                                <?xml version="1.0" encoding="utf-8"?>
                                                                <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                                                                                                                     xmlns:s="library://ns.adobe.com/flex/spark" 
                                                                                                                     xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="creationCompleteHandler(event)" width="800" height="600">
                                                                          <fx:Script>
                                                                                    <![CDATA[
                                                                                              import mx.events.FlexEvent;
                                                                
                                                                                              protected function creationCompleteHandler(event:FlexEvent):void
                                                                                              {
                                                                                                        trace("SWCFlexTest.creationCompleteHandler(event)");
                                                                
                                                                                                        this.content = new SWCTest();
                                                                                                        this.contentContainer.addChild(this.content);
                                                                                              }
                                                                
                                                                                              public var content:SWCTest;
                                                                
                                                                                    ]]>
                                                                          </fx:Script>
                                                                          <fx:Declarations>
                                                                                    <!-- Place non-visual elements (e.g., services, value objects) here -->
                                                                          </fx:Declarations>
                                                                
                                                                          <s:SpriteVisualElement id="contentContainer" width="550" height="400" horizontalCenter="0" verticalCenter="0" />
                                                                
                                                                </s:WindowedApplication>
                                                                
                                                                

                                                                 

                                                                 

                                                                This will allow the ADT compiler to pick up all the necessary class linkages so they can be cross compiled into native ARM code.

                                                                • 29. Re: Problem with Flex mobile app on iOS
                                                                  alinator11 Level 2

                                                                  Very cool. Thanks dr_eunuch_maker.

                                                                   

                                                                  I am able to get to the invidual components in the fla, but I am not able (yet) to get the main movie to play with all components automatically added to stage without instantiating  each component individually. Thus, I have sent the FLA to the designer and asked him to put everything under one MovieClip to see if that helps. When I was using SWFLoader, of course, all this loaded up without any fuss. However, I adore the fine grained control I have over the components now and  adore even more that I'm pointed in the right direction. Dealing with format and layout issues is a far more welcome problem.

                                                                   

                                                                  Along with the steps you explained above, I also added the swc to the build path of my flex project and copied the swc to my flex project's lib directory.

                                                                   

                                                                  Thanks again drkstr_1.

                                                                  • 31. Re: Problem with Flex mobile app on iOS
                                                                    alinator11 Level 2

                                                                    Thanks a bunch guys. After a bit of internet searching, I found the latest FlexComponentKit (2.0.0). It's not easy to find so if anyone is looking for it, it's here: http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/frameworks/flash-integration/

                                                                     

                                                                    I am using CS5.5 and have found 2.0.0 to work great with it.

                                                                     

                                                                    After installing the framework, I had my designer take all the contents of the FLA and put them into one (1) movieclip. Using Flash Pro, I then gave that MovieClip an instance name and I tied it to ActionScript. When I linked it to ActionScript, I changed the default parent class from flash.display.MovieClip to mx.flash.UIMovieClip. As soon as you do that, the library symbol changes from a MovieClip symbol to an actual FX symbol. Then I published to swc.

                                                                     

                                                                    After publishing to SWC, I switched over to Flash Builder, opened my project and ran a test. I was able to instantiate the objects within the FLA, including the parent MovieClip, and get reference to all the children. Perfect! Thanks a ton for the help guys.

                                                                    • 32. Re: Problem with Flex mobile app on iOS
                                                                      madhu_51 Level 1

                                                                      Hi ,

                                                                       

                                                                      I am facing issue wile loading swf from past 1 week. I am using adobe flex 4.5.1 for mobile project. I got .swf file from third person i am totaly unaware of file .

                                                                      Initially i was facing compile time error for the same .swf so as you posted i tried to follow your steps,

                                                                      First I made a new project

                                                                      1. Took the intro SWF and made a new Flex Mobile project with that SWF in the "bin-debug" folder.

                                                                      2. Made an .AS file with the same name as the SWF in the "default" source folder.

                                                                      3. Configured Intro-xml as a mobile app.

                                                                      4. Tested and ran that with standard packaging to iOS ipad simulator . i was succesfull abble to do this

                                                                       

                                                                      But after two three instances of run in simulator .swf will not load again and default home screen will be displayed.

                                                                       

                                                                      So i do not have real device to test  how it will beahave on it. Can you please tell me how i can ensure it will load at each launch.

                                                                       

                                                                      Regards,

                                                                      MAdhu