6 Replies Latest reply on Aug 25, 2011 1:50 AM by Antoine Barrau

    Embedding SWF for ios, several issue

    Antoine Barrau

      Hi,

      i'm currently trying to do two things :

      - I've embeded a simple SWF on a flex mobile project just by changing the initialwindow/content to "myswf.swf". It work perfectly on simulator, packaging is running well, but when i try to run it on IPAD, it seems that actionscript command have disappeared. The swf is running like a video. Any ideas?

       

      - I'm trying to embed a larger project, composed of several SWF loaded from a main one. I've read that ios is not supporting that type of architecture, and that i have to create a SWC with all my SWF to create a single .ipa. Does someone can tell me how i'm supposed to create that swc (just creating a library project, cut/paste all my swf file on src and compile it to swc?) and more important, how do i then load the first SWF supposed to be the main one?:b

       

      Thanks a lot,

       

      Antoine

        • 1. Re: Embedding SWF for ios, several issue
          artguate Level 2

          Apple's EULA forbids the execution of code that is not compiled with their stuff.  Not exactly in those terms, but that's the idea.  While you can embed swf, the action script is ignored becuause Apple says so.

           

          You can have multiple swcs, just link them to one executable, not embeded and it should work just fine.

           

          Edit.

          Do you have the code for the SWF files, or are these extarnal that you don't have access to the code.

           

          If you have access to the code, you can make a library project and in your main project just add that library project in the properties Library Path in Flex Build Path option.

          • 2. Re: Embedding SWF for ios, several issue
            Flex harUI Adobe Employee

            I'm not sure that's technically correct, but the fact remains that

            actionscript in a SWF cannot be run on IOS.

            • 3. Re: Embedding SWF for ios, several issue
              artguate Level 2

              You are right is not the EULA; it's the iOS Developer Program License Agreement.

               

              3.3.2 An Application may not download or install executable code. Interpreted code may onlybe used in an Application if all scripts, code and interpreters are packaged in the Application andnot downloaded. The only exception to the foregoing is scripts and code downloaded and run byApple's built-in WebKit framework

               

              It's still because Apple doesn't want you to.  Adobe just complies with the agreement.

              • 4. Re: Embedding SWF for ios, several issue
                Flex harUI Adobe Employee

                Well, I'm not a lawyer, but why wouldn't an embedded SWF be "packaged in the

                application" and therefore allowed?

                 

                I still think there is more to it than that, but the end result is the same.

                • 5. Re: Embedding SWF for ios, several issue
                  artguate Level 2

                  Neither am I.

                   

                  But I was told that the reason behind the decision is "that" clause.

                   

                  I guess it may have something to do with how executable embeded swf's are loaded, it could be considered in broad sense "downloaded", and therefore break the agreement, or maybe simply the team decided that disabling it all toghether would not leave loopholes that could give Apple a reason to not allow Flex apps to run on iOS again.

                   

                  So yeah, at the end, it's a small price to pay for the benefits it provides.

                  • 6. Re: Embedding SWF for ios, several issue
                    Antoine Barrau Level 1

                    Hi,

                    Thanks for your answer.

                    For the moment, i have only the swf files, since they are produced

                    automatically by another tools. So i can only build my SWC by adding swf as

                    embeded ressources, and use swfloader on my main view to load one. I'm not

                    sure of the method indeed.

                     

                    Another strange behavior is that Flash Builder 4.5 is now producing me blank

                    swf at release, even if everything work fine with desktop simulator... and

                    i've tried it with very simple example (like an "Hello world" mobile

                    application).. But that may be another problem :/

                     

                     

                    2011/8/24 artguate <forums@adobe.com>

                     

                    Apple's EULA forbids the execution of code that is not compiled with their

                    stuff.  Not exactly in those terms, but that's the idea.  While you can

                    embed swf, the action script is ignored becuause Apple says so.

                    >

                    You can have multiple swcs, just link them to one executable, not embeded

                    and it should work just fine.

                    >

                    Edit.

                    Do you have the code for the SWF files, or are these extarnal that you

                    don't have access to the code.

                    >

                    If you have access to the code, you can make a library project and in your

                    main project just add that library project in the properties Library Path in

                    Flex Build Path option.

                    >