create an empty 1st keyframe in your external swf and mask the stage.
I'm having this exact same problem. I'm creating a gallery of about 30 student made swf animations. I'm trying to create a flash app that will load the external swf's and display them on the stage.
I make a mask that dynamically changes depending on the size of the loaded swf (loader.width, loader.height), but flash gives me the width and height values based on the dimensions of all the graphics on the first frame, and not the height and width of the external swf's stage. If there was simply a way to get the stageHeight and stageWidth of the external file when it loads, then all would be right with the world.
Anybody know a way to do this?
if all the swfs are as2 swfs you must loop through all the frames of the external swf (not displaying this to the user) updating the main timelines width/height to make sure you have the max width/height that will be displayed. you can then return to frame 1 of the external swf and display it to the user.
Does doing that takes only into account width and height of the stage, or also considers off stage items (as in the initial question)?
I am also looking at this issue and we can't have all the content providers modify their pre-existing flash applications to be displayed in the appropiate scale. We are looking to any of the following:
- find a way to get adobe air/flash to not consider the off stage elements on the width/height we set to the movie.
- find a way to get the stage size from the external movie and use that to auto calculate the resize needed.
- any other alternative that allows to have the same end result, which is loading up the external content at the size we specify and displaying well. We can actually hide content outside the stage, but we still need to know the appropiate scale / size to apply to the movie so what's visible matches the are where we want to show the content.
you will detect off-stage items in the external swf.
if you have not control of the external swfs and no way to enforce some common actionscript to the external swfs, there's no way, during runtime, you can reliably determine the fla stage size setting used to publish the swf.
I didn't notice before this was posted in AS 1/2.
We found a way to get it working on our air app. It's using flash.display.loader and its working effectively with the external swf we have tried it - both with files that have the off stage issue and files that don't..
var fullWidth:Number = loader.content.width;
var fullHeight:Number = loader.content.height;
var stageWidth:Number = loader.content.loaderInfo.width;
var stageHeight:Number = loader.content.loaderInfo.height;
var fixOffStageScaleX = fullWidth / stageWidth;
var fixOffStageScaleY = fullHeight / stageHeight;
kglad, is that a new feature/behavior or do u know of any issue with it?
Ps. We will certainly be looking at how it behaves with plenty of more content as we have an ongoing private beta.
in as3 this issue was solved (as you found) by the stage.stageWidth and stage.stageHeight properties. it works not only for air files but also non-air swf files.
Ok, there isn't much Correct information regarding it though.
Carefull, as we are not using stage.stageWidth as that doesn't helps at all i.e.
Remember that regardless of scale mode (mentioned on the doc), .stage refers to the main movie's stage, so there is no chance .stage.stageWidth will ever give u info on the external movie.
HI IAIM NEW TO ADBE LIKE USEING IT WOULD TO LEARN MORE.FOR MOVES AND MUISC, CLUB MIX MUISC ON MY COMPETER.
NEED HELP. THANK YOU.
Was there any conclusive fix to this problem? I am having the exact same issue. I attempted what kglad said and applied a mask to the stage, but that did not seem to work. I am loading a movie from flash cs4 using 3d transition (parallax) into an actionscript project i am building in flex builder 3. Since the objects are required to be scaled up after pushing them back on the z axis they spill out of the stage onto the screen. Could someone tell me what worked? Thank you in andvance.