# Truly centered non-resizable swf in a browser window

**URL:** <https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526>\
**Category:** Uncategorized\
**Created:** [April 17, 2003, 3:17pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526 "2003-04-17T15:17:02Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![dk1](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@dk1](https://forum.kirupa.com/u/dk1)\
**Post date:** [April 17, 2003, 3:17pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/1 "2003-04-17T15:17:02Z")

</div>

I found a page that launches a full-screen browser window with a SWF in it. This SWF is non-resizable, and it is centered inside a browser window in such a manner, that both bottom AND TOP get cut off if the screen size is smaller than that of a flash file.

Usually an embedded SWF would be tied to top left corner of the browser window in case of a smaller screen. In other words, top edge and left edge of a SWF file would always start at 0, 0 if the screen is too small.

Not in this case though. Check it out at [designchapel.com](http://designchapel.com) : [http://www.designchapel.com/](http://www.designchapel.com/)

Java script on the index page launches the full-screen browser window. But what makes the movie inside that window perfectly centered, even on a smaller (i.e. 800x600) screen, letting its BOTH bottom AND TOP edges be clipped? Is there some flash code for it? I couldn’t find anything in the html code.

Thanks  
dk

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 3:28pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/2 "2003-04-17T15:28:00Z")

</div>

i saw this a couple of weeks ago and added it to my favs…

very talented designer…

unsure, but it might work if it has a fullscreen command in the first frame of the movie

getURL(“FSCommand:fullscreen”, “true”);  
getURL(“FSCommand:allowscale”, “false”);

it should size to any browser without distortion

hope this helps u

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 3:42pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/3 "2003-04-17T15:42:02Z")

</div>

Tried it. Didn’t work unfortunately.  
Thanks for the advice though. I don’t suppose you might have any other guesses here? This is driving me nuts.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 3:56pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/4 "2003-04-17T15:56:22Z")

</div>

maybe he has something in there that is constraining the movieClip to be at an exact position depending on the resoulution size…

ask lostinbeta…

he is one of kirupas resident flash gurus…

sorry i can’t be of more help

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 5:09pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/5 "2003-04-17T17:09:45Z")

</div>

fscommand is only from the Flash projector… it doesn’t effect the browser at all :nerd:

If you want a centered pop up that isn’t resizeable, check my attachment, it is a centered pop-up script I wrote a long time ago, it involves you putting javascript in the HTML page and calling the function in Flash with a getURL.

And I AM NOT A GURU!!! I am a flasher in training :nerd: :ub:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 5:13pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/6 "2003-04-17T17:13:59Z")

</div>

he he…

no need to be humble m8…

i haven’t a clue what you r talking about half the time…

but it sure looks good

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 5:18pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/7 "2003-04-17T17:18:01Z")

</div>

Im not being humble… I am definitely not a guru. I know more than others, but I also know a lot less than many others as well.

Im the middleman 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 5:43pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/8 "2003-04-17T17:43:43Z")

</div>

I think what dk1 was talking about is actually happening in flash. I agree, the centered popup is in javascript, and is easy to make, however, if you take a close look at the site dk1 mentioned, it is actually an MC being centered in the middle of a swf(to see what I mean, go [here](http://www.designchapel.com/main.htm) and resize the browser with your mouse). You’ll see that the width of the swf never changes, but the height does(set to 100% in the html), however it seems to keep proportions. Therefore i’d conclude that the main site is an MC inside of the swf and controlled by actionscript. This is the reason the top and bottom are being cut off, because it’s not the swf that’s repositioning, its the MC in it.

I haven’t tried it out yet, but it’d seem pretty easy to do. Just using \_xscale, \_yscale, and having the registration point at the center of the MC, it’d seem easy to get this effect. I’ll post later if I have the time to try it out… 🙂

Stefan

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 5:46pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/9 "2003-04-17T17:46:05Z")

</div>

Uh, I’m not sure if I understand your question, but here’s some centering HTML code that may help:

```auto

<table border=0 width=100% height=100%><tr><td align=center valign=center>
INSERT FLASH OBJECT CODE HERE!
</td></tr></table>

```

Maybe I’m just being stupid and not understanding the question, which is pretty typical of me…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 8:01pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/10 "2003-04-17T20:01:15Z")

</div>

No guys, my question isn’t about launching a non-resizable pop-up in the center of the screen, nor is it about embedding flash movie in the center of the html page.

It is about having a flash movie that’s 1. aways centered (no matter what screen size), 2. does not get scaled down, but 3. gets cropped on ALL FOUR sides (not just the right side and the bottom) if the screen is smaller that flash file. It’s the 3rd part that I can’t get answered.

The fellow at [designchapel.com](http://designchapel.com) has done exaclty that. Only the code that makes it work isn’t in html, it’s in flash file itself. The only script he uses in html is the one that launches a full-screen non-resizable window, but it isn’t what I was asking about. If you set your screen to 800 x 600, THEN launch [designchapel.com](http://designchapel.com) , you’ll see that the main page will be same scale, but will be cropped on all four sides (as opposed to, say, 1600x1200 screen size, when the page can be seen in its entirety).

How in the world has he done it, I can’t figure out. Tried to see the SWF file in Word, but it’s difficult to read the code with all the extra bizzare characters that appear if you open a flash movie in Word.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 8:04pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/11 "2003-04-17T20:04:13Z")

</div>

innui -  
isn’t the size of the parent movie going to influence the MC in it? Centered or not, it’s still going to appear within the parent SWF, and it’s the one that gets embedded in html page…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 8:19pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/12 "2003-04-17T20:19:39Z")

</div>

Well you can’t really do it without scaling unless you position your elements according to stage coordinates (in MX only), not exactly sure how well that works.

I checked out the source code of design chapel (great site btw) and I see he has the width of his movie as 700 and the height of the movie set to 100%. And the embed code is between html center tags. This could be how he does what you are talking about.

Other than that, I have no clue, I am on an 800x600, so I can’t see how it looks on larger.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 8:32pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/13 "2003-04-17T20:32:30Z")

</div>

LiB, it actually makes me a bit sad that you consider yourself a middleman. If that’s really the case, it would mean that I’m really a Flash-illliterate… ☹

Oh, well, I’ll just keep on trying (-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 8:40pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/14 "2003-04-17T20:40:00Z")

</div>

Well consider how high the bar was set with Robert Penner, Keith Peters, Jared Tarbell, etc, etc. The bar for guruism in Flash is pretty high. I still learn a lot about Flash every day, but thats the fun of it 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 9:01pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/15 "2003-04-17T21:01:42Z")

</div>

Well, I believe I figured it out, and it’s much more simple than I thought. I’ll post the files so you can see how it was done. There was an MC made in flash with the top and bottom content running off the flash border, and with the following actionscript:  
[AS]onClipEvent(enterFrame) {  
\_xscale = \_yscale;  
}[/AS]  
simple enough. Then, in the HTML, all that was done was the \<CENTER\>\</CENTER\> Tag, and setting the height to 100%. Just as I said before, it would be pretty easy, and it works. This doesn’t include the javascript to open the window according to your resolution, but that wasn’t the point being questioned, heh.

If you compare my [html side by side with the link directly to [URL=http://www.designchapel.com/main.htm]www.designchapel.com/main.htm](http://www.stefangomez.com/abscenter/browsertest.html) , it works exactly the same!

-Stefan

edit-- my host for my html link, isn’t being reliable right now, but it’ll still works in the attatchment I posted

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 9:11pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/16 "2003-04-17T21:11:31Z")

</div>

here’s the attatchment in zip format w/fla html and swf

-stefan

-update…arg, keep uploading the wrong file…here it is finally.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 18, 2003, 1:30pm UTC](https://forum.kirupa.com/t/truly-centered-non-resizable-swf-in-a-browser-window/18526/17 "2003-04-18T13:30:54Z")

</div>

Awesome!! Thanks a lot for your help. This thing has been driving me nuts.
