views:

121

answers:

2

I'm sure this is very simple, but it's not readily apparent how to do it.

I created a flash file. Uploaded the file to my server. I'm going to it at blahblah.com/demo.swf , not included in any html or anything.

When I go to the file, the browser loads it in "fullscreen" mode, taking up the entire window size. The size changes as the window is resized. All of the stuff that I've hidden off the stage is there to see, and all of the background takes the stage's background color.

I want the file to instead show only the stage, correctly proportioned. I'm using Flash CS4 with ActionScript3.

Help?

+2  A: 

What you're doing is downloading the file and running it in your default Flash player. If you mean to load and play the SWF in a browser, you'll need to reference it in an HTML file and then point your browser at that HTML file to view it correctly.

EDIT: To do so, create an HTML file (with all the appropriate tags, HTML, BODY, etc.) and add something like the following inside the BODY:

<object width="550" height="400">
<param name="movie" value="somefilename.swf">
<embed src="somefilename.swf" width="550" height="400">
</embed>
</object>

Change the width, height, and SWF names (both 'value' in param and 'src' in embed) as needed. Then, upload the HTML file to your server and type the URL for that location in your browser to view the SWF.

Michael Todd
Thanks, I guess this is just the easiest way.
cksubs
+2  A: 

I think all you need to do is setup your stage.

1.pick a stage align e.g.

stage.align = StageAlign.TOP_LEFT;

2.pick a scale mode e.g.

stage.scaleMode = StageScaleMode.NO_SCALE;

play with the scale modes and pick the one that best suits your needs.

You might want also to listen for the RESIZE event on your stage to update your objects, dependings on the scale mode.

Goodluck.

George Profenza