/    Sign up×
Community /Pin to ProfileBookmark

using availheight & availwidth to automatically resize flash

I’m currently working on my first ever webpage (which will be entirely in flash), I have little knowledge of html and no knowledge of javascript so please keep any responses very simple and clear or I won’t understand!.
I want the swf to automatically resize itself depending on the available height and width inside the browser, taking into account tabs etc. I’m currently using this code to link to html files exported from flash pro 8, which i have edited to resize the swf to fill the usable area (using width=”” & height =””). This allows me to define a size for ie and a size for firefox (by having different figures for object and embed within the highres.html or lowres.html), so I now have four sizes of swf available.

[CODE]<SCRIPT language=”JavaScript”>
<!–
if (screen.width>=1280)
{
window.location=”highres.html”;
}
else
{
window.location=”lowres.html”;
}
//–>
</SCRIPT>[/CODE]

This however can’t take into account the variety of configurations eg. tabs and bookmark toolbars in firefox etc. So what i’m really looking for is to just have a single html file that includes availheight & availwidth information and then applies these figures to the width=”” & height=”” html tags.
As I previously mentioned I have zero understanding of java and would really appreciate it if someone could create this and explain how to implant it into the flash exported html file. It has taken me ages to get this far and now i appear to have hit a brick wall!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@mrhooSep 19.2006 — The screen properties tell you the total available if the window is maximized-

a lot of people don't run the browser maximized, it's better to get the actual window dimensions.
Copy linkTweet thisAlerts:
@anthonymtauthorSep 19.2006 — ok, it appears that just by using height="100%" & width="100&" i get the desired result. Oh well, I did say that I am new to this!

I do have another query though, it seems that the code i placed in my original post doesn't work in IE, instead of sending the user to the correct html file it just goes straight to the highres.html regardless of screen resolution. Any ideas?
Copy linkTweet thisAlerts:
@anthonymtauthorSep 19.2006 — I also have another problem now, when using IE with scroll="auto" in the html to remove the scrollbar, the swf is only stretched to fit up to where the scrollbar would be if it were there. The scrollbar is invisible but not actually covered by the swf.
×

Success!

Help @anthonymt spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...