| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Me
|
A warm hello to all, am I the first person to post a thread here??
![]() Anyways, here's the situation: If you'd have a flash-movie (sized 100% by 100%) embedded in a html-file and in the flash-movie there'd be a textbox displaying Stage.width and Stage.height then when I view the movie the text would be "976 x 753"... Now my question is, could I get that values by detecting the canvas-sizes using javascript? To clear things out: I'm NOT looking for flashmovies passing through values to htmlfiles. I only want to know if there is a way for javascript to check what the height and width of the canvas are, NOT the whole screen or anything, just the sizes of the space where my website is displayed... - Ruben
__________________
. Originally Posted by MichaelxxOA "He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit." |
|
|
|
|
|
#2 |
|
Canadian Flasher
Join Date: May 2002
Location: T dot O dot
Posts: 1,651
|
|
|
|
|
|
|
|
|
|
#3 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
uhmmm, if your swf is set to 100%X100%, wouldn't that be the screen size?
__________________
tg --- what the hell was i thinking? |
|
|
|
|
|
#4 | ||
|
Me
|
Quote:
But thanks anyways ![]() Quote:
Code:
width = "100%" height = "100%" Thanks anyway - Ruben
__________________
. Originally Posted by MichaelxxOA "He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit." |
||
|
|
|
|
|
#5 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
right, gothcha, i don't do much with 100%, so i don't so if this sounds kinda sarcastic, its not meant to.
so if you use javascript to find window.innerHeight, and window.innerWidth, then that might give your the same size as your stage (but i don't know for sure). innerWidth/height should work for nav4+, so might work for mozilla/firefox. but it won't work for ie.
__________________
tg --- what the hell was i thinking? |
|
|
|
|
|
#6 | |
|
Me
|
Quote:
So while we're at the browser-topic: I got this piece of javascript from kirupa to check what browser the user's using: Code:
function checkBrowser() {
var IE = document.all;
var oldNS = document.layers;
var newNS = !document.all && document.getElementById;
var opera = window.opera;
if (opera) {
window.location = "opera.html";
} else if (oldNS) {
window.location = "oldns.html";
} else if (newNS) {
window.location = "newns.html";
} else if (IE) {
window.location = "ie.html";
};
};
Thanks alot for reading/replying - Ruben
__________________
. Originally Posted by MichaelxxOA "He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit." |
|
|
|
|
|
|
#7 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
just a guess, i'm not positive, but i'ld say <= net5
__________________
tg --- what the hell was i thinking? |
|
|
|
|
|
#8 | |
|
Me
|
Quote:
- Ruben
__________________
. Originally Posted by MichaelxxOA "He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit." |
|
|
|
|
|
|
#9 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
hehheh.
oldNS=all netscape browsers older than (and including) netscape 5. newNS=all netscape/mozilla browsers based on netscape code newer than netscape 5 browser again... i'm not positive about the number, but i think mozilla is based on the netscape 6 gecko engine, so thats why i figured 5 as the cuttoff for old.... maybe its 6 ... not sure.
__________________
tg --- what the hell was i thinking? Last edited by tg; 07-12-2004 at 05:57 PM.. |
|
|
|
|
|
#10 |
|
Me
|
Oh, glad you could clear that one out for me, thanks heaps...
So no-one knows how I can check wether or not the user is viewing through FireFox?? - RubenPS. I keep asking, don't I? ![]()
__________________
. Originally Posted by MichaelxxOA "He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit." |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|