Stuff outside the stage when resizing

Hey guys,

When setting the HTML publish settings to percent, why does the published page show stuff that is outside the stage (but in the work area)???

Is there any way to publish the animation showing only the stuff on the stage and not anything outside it??

Your width and height don’t atake up the whole page

Yes, do this:

Create a MC called “stage_mask” and make sure the registration point is in the center. Inside the stage_mask MC draw a square (any width/height) with any stroke/fill color.

Right-click the stage_mask MC in the library and select “Linkage…”. In the linkage dialogue make sure that “Export for ActionScript” is checked (it will automatically check “Export in First Frame”) and set “stage_maskMC” as the linkage identifier.

Now, go to the first frame of your movie and insert a layer called “Actions”. Insert the following code:


_root.attachMovie("stage_maskMC", "maskMC", 1);
with (_root.maskMC) {
          _width = [movie width];
          _height= [movie height];
          _x = Stage.width / 2;
          _y = Stage.height / 2;
}
_root.setMask("maskMC");

The only thing left to do is take your desired display area (namely your movie’s width and height) and set the x/y of the mask to that width/height. You COULD do something like:


_width = Stage.width;
_height = Stage.height;

But as soon as someone resizes your movie, your stage dimensions are going to change and then they’d be able to see things outside of the artboard – negating any good this script would’ve done.

Another thing to check out is the fscommand allowscale. It’ll keep your SWFs from being automatically resized:


// first frame of your movie
fscommand("allowscale", false);

There are many more fscommands, too. It all depends on what you need to accomplish.

How i do it is make a mask to show what you want but if there is another way to do it (a better way) please tell.

wow, thanks a lot newhopekenny, that was perfect.

While i’m on the subject, how come the HTML resizing doesn’t work with firefox?? It’s fine in IE, but in FireFox It shows the animation smaller (rather than bigger)

isn’t one of the publish settings “exact fit”, why wouldn’t you just use that?

D’fferent strokes, d’fferent folks I guess – but that is a really good question.

If you’re just placing your SWF inside of a web page, I’d strongly suggest using pixel width/height for accuracy and cross-browser stability.