Truly centered non-resizable swf in a browser window

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://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

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

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.

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

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:

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

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 :stuck_out_tongue:

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 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… :slight_smile:

Stefan

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


<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…

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 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 , 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.

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…

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.

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… :frowning:

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

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 :slight_smile:

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 , 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

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

-stefan

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

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