9 Replies Latest reply on Sep 16, 2016 12:37 PM by garybrindley

    Large external swfs cause the stage to "zoom"

    garybrindley Level 1

      I have a project (AIR for desktop) that is used a full screen "kiosk" app on a large touch screen PC.

       

      I need to import som swfs that are 360 views of rooms (a bit like QTVR but they are swfs). They work fine independently.

       

      When I use AS3 to load them into my Animate project they appear, but the entire project stage is "zoomed" and it appears this is because the swf's are so large.

       

      I tried the same technique with a small sample swf I created and it works perfectly.

       

      I am completely stuck on this one at the moment!

        • 1. Re: Large external swfs cause the stage to "zoom"
          kglad Adobe Community Professional & MVP

          what's the stage size of the main swf and what's the stage sizes of the problematic loaded swfs?

           

          unless they are the same, you can't expect the loaded swf to be scaled to fit your main swf stage.  you should do that manually when loaded is complete.  ie, in a a complete handler, resize the content of the loader.

          • 2. Re: Large external swfs cause the stage to "zoom"
            garybrindley Level 1

            The stage size is 1536 x 2048px.

             

            I'm not sure how to find the size of the swfs. I didn't make them. Is there a simple way to get this meta data from a swf?

             

            They definitely aren't the same (the swfs are square/ slightly landscape and my stage is portrait to start with). I had tried to write something that would resize them but I am new to AS3 so I can see I could easily go wrong here. Could you post an example of how go about this please?

            • 3. Re: Large external swfs cause the stage to "zoom"
              kglad Adobe Community Professional & MVP

              var loader:Loader=new Loader();

              loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);

              loader.load(..etc);

               

              function completeF(e:Event):void{

              loader.width=stage.stageWidth;

              loader.height=stage.stageHeight;

              // or resize maintaining aspect ratio and position

              }

              1 person found this helpful
              • 4. Re: Large external swfs cause the stage to "zoom"
                garybrindley Level 1

                Thanks, I'll code this and see how it goes (and post result)

                • 5. Re: Large external swfs cause the stage to "zoom"
                  garybrindley Level 1

                  Hi kglad,

                   

                  No, it seems this gives me the same issues I've met with all other techniques. It works with the sample swf file I created but not with the swf's I've been sent. The stage just zooms to what appears to be twice its normal size.

                   

                  Because this is a kiosk I had some code at the start:

                   

                  //Set up the full screen display

                  stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

                  stage.scaleMode = StageScaleMode.NO_SCALE;

                   

                  but for the purposes of testing this I commented that code out. That made no difference though

                   

                  With these swfs, it seems to ignore any attempt to scale them, although if I open the swf directly I can scale the window, no problem.

                  • 6. Re: Large external swfs cause the stage to "zoom"
                    kglad Adobe Community Professional & MVP

                    what happens if you open the problematic swfs without loading them into another swf?  do they also 'zoom'?

                    • 7. Re: Large external swfs cause the stage to "zoom"
                      garybrindley Level 1

                      No, they work normally.

                       

                      The swf itself does not "zoom in", it's the stage of the FLA project I'm working on that zooms in.

                       

                      I've now created a simple project (not AIR for desktop this time, just Actionscript 3.0) with nothing but this example.

                       

                      The testswf.swf I create loads fine and scales fine.

                      The swf I need to work (well, one of them anyway) I test with the same code and it does not appear.

                      I can't help think there's something about the size that is causing this problem.

                       

                      Is there a way I can send you the test file with the swf I'm having the problem with? I've asked the creator of the large swf files for as much info as possible.

                      • 8. Re: Large external swfs cause the stage to "zoom"
                        kglad Adobe Community Professional & MVP

                        i don't download and correct files unless i'm hired.

                         

                        you could upload the main html and swf and problematic swf and i'll test the load to see if i can be more helpful.

                        • 9. Re: Large external swfs cause the stage to "zoom"
                          garybrindley Level 1

                          Fair enough. My original file is not HTML, it's an AIR package for desktop.

                           

                          My simple test file is just an ActionScript 3 file, again not HTML.

                           

                          I've started looking at GSAP as that framework has a loader that looks like it has useful features. Using that I can see it loads the file ok (it's 44Mb) and with no settings at all it is displayed, just much too large. As soon as I use GSAP to scale, move, etc, I don't see it at all. I feel like I'm getting closer this way though so I'm going to play with this code a little more before I upload anything.