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.
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?
1 person found this helpful
var loader:Loader=new Loader();
// or resize maintaining aspect ratio and position
Thanks, I'll code this and see how it goes (and post result)
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.
what happens if you open the problematic swfs without loading them into another swf? do they also 'zoom'?
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.
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.
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.