To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 05-11-2006, 09:10 AM   #1
artlink
Senior Member
 
Join Date: Apr 2005
Posts: 467
100 percent in Browser

I was wondering if you can set the stage size at 100 percent when the swf is embeded in a browser, the way you can do it localy in the flash player.

That means that you see the stage at its own size + you have all the area surrounding that stage which is part of the same swf.

Basicaly I've got my main area (800/600 px) that people can use for those who have small resolution screen, and I want to let the possibility for those who'll see it on a 1024/768, to have the main area still on 800/600 + access on the outer zone around that 800/600 to play with, for instance to drag and drop things out of the main area.

Kinda impossible to explain really, so I attached a gfx to get it clearer.
So basicaly I want to have the "100 %" feature when swf is in a browser.

I aint asking for my swf to scale 100% with the browser (I know how to do that), but for the main stage of my flash to remain at 800/600 while - if browser maximize - the zone around is still my swf.

Actually I am even wondering if its possible whithin a browser.

Jee
Attached Images
File Type: gif 100.gif (7.1 KB, 21 views)
__________________
Hope nobody knows I am still on Flash 5
______________________________________
All artists are prepared to suffer for their work
but why are so few prepared to learn to draw?(Banksy)
artlink is offline   Reply With Quote
Old 05-11-2006, 10:21 AM   #2
olias32
Senior Member
 
olias32's Avatar
 
Join Date: Jan 2003
Location: Romania
Posts: 126
i had the same problem. its not easy to do because its not just flash, its also some HTML code.

check out www.improvizati.ro (its a site i made that does this)

in the flash timeline you have to use on a frame:
Code:
fscommand("allowscale", false);
fscommand("fullscreen", false);
and then in the HTML, inside the flash OBJECT tags, add (or modify if the properties are there already) the next code:
Code:
WIDTH="100%" 
HEIGHT="100%" 
ALIGN=""
next, lower down (along with the other param name tags that are already there):
Code:
 <PARAM NAME=scale VALUE=noscale>
 <PARAM NAME=salign VALUE=LT>
and also lower:
Code:
scale=noscale 
salign=LT 
WIDTH="100%" 
HEIGHT="100%" 
ALIGN=""
make sure you have them just right, or it will not work.
in case you dont understand, just view the source on my page and you'll get it

Now the swf will expand its borders to fit the window, without scaling its content.
PS be sure you dont put your flash inside a table with fixed width, as this will not allow it to expand.
__________________
http://www.fishstudio.ro
olias32 is offline   Reply With Quote
Old 05-11-2006, 11:29 AM   #3
artlink
Senior Member
 
Join Date: Apr 2005
Posts: 467
Very nice one Olias32.

here's the result: http://www.whatif.ie/shandon/

it's still a work in progress, so lot of things still to be loaded/optimized/finished.

No table allow here, so can I get the swf to be centre horizontaly and verticaly with this technique?

I have tried: ALIGN="middle" but it stay stuck on the top left.
__________________
Hope nobody knows I am still on Flash 5
______________________________________
All artists are prepared to suffer for their work
but why are so few prepared to learn to draw?(Banksy)
artlink is offline   Reply With Quote
Old 05-11-2006, 02:32 PM   #4
olias32
Senior Member
 
olias32's Avatar
 
Join Date: Jan 2003
Location: Romania
Posts: 126
centering is done from flash.
you have to add this to the first frame of your movie

Code:
function center() {
  center the content;
}

center();

myinterobj = {};
myinterobj.onResize = center();

Stage.addListener(myinterobj);
ok, and now to explain:
have all your content placed in a MC in the root of the flash (called for example main, and the function center should be something like:

Code:
function center() {
  main._x = (Stage.width - main._width) / 2
  main._y = (Stage.height - main._height) / 2
}
*dont know if this works with _root as the MC to center. worth a try. (like _root.x = ..etc)

next i call the function once, to make sure the content is centered when the flash is opened the first time.

last i make a listener which centers the flash content (the MC main)everytime the window is resized.
hope it helps

cheers
__________________
http://www.fishstudio.ro
olias32 is offline   Reply With Quote
Old 05-11-2006, 03:37 PM   #5
artlink
Senior Member
 
Join Date: Apr 2005
Posts: 467
which version of flash do I need for that?
__________________
Hope nobody knows I am still on Flash 5
______________________________________
All artists are prepared to suffer for their work
but why are so few prepared to learn to draw?(Banksy)
artlink is offline   Reply With Quote
Old 05-11-2006, 05:09 PM   #6
olias32
Senior Member
 
olias32's Avatar
 
Join Date: Jan 2003
Location: Romania
Posts: 126
well i did it first on flash mx last year.
and recently i switched to flash 8, and it still works.

dont know about flash 5 though... did you try it and it didn't work?
if so, i'll try setting my export options for flash 5 and see how it behaves

cheers
__________________
http://www.fishstudio.ro
olias32 is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:22 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.