Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
| Subject: | Re: FLASH: 2 great books, but where does one learn Actionscripting? |
| From: | 2Nerotik |
| Date: | Fri, 4 Feb 2000 07:50:33 GMT |
Speaking of JavaScript I just put together a little detection script that
detects the users
screen size and loads an appropriate background image.
Just thought I'd throw it in, maybe someone here has and application for it
in Flash.
It's really very very simple.
< SCRIPT Language="JavaScript1.2">
<!--
function getWallpaper() {
if (screen.Width == 1024) {
i = 0 }
if (screen.Width == 800) {
i = 1 }
if (screen.Width == 640) {
i = 2 }
image = new Array(3);
image[0] = "1024.jpg";
image[1] = "800.jpg";
image[2] = "640.jpg";
document.write('<BODY BACKGROUND="' + image[i] + '" BGPROPERTIES="Fixed">');
}
//** end hiding of JavaScript -->
< /SCRIPT>
This part goes wherever you want the image to be:
<SCRIPT> getWallpaper(); </SCRIPT>
Alternate to the BODY tag use the following style instead:
document.write('<STYLE> body { background: url(' + image[i] + '} </STYLE>');
Both tested and work perfectly.
At 08:07 PM 03/02/2000 -0500, unique wrote:
>Great post, Michael. I was just thinking along the same lines last night. I'd
>just received *JavaScript Goodies* by Joe Burns and Andree Growney. I was
>reading Joe's introduction about how he discovered, after wading through 4
>hefty
>tomes about JavaScript, that *tearing apart* JavaScript (written by others,
>obviously) is (at least for many) the best way to learn the/a language.
>
>Now I *want* to learn JavaScript *anyway*, but, even if I were, say, someone
>like *Tom Green* ;-), I believe I'd *still* invest my time in working through
>Joe's and Andree's book *because* of its finely-detailed analyses of
>*everything*.
.oOo.
|| Some mistakes are too much fun to only make once.
||
|| Addicted 2 Swing ---> http://www.nisa.net/~2nerotik/
|| Fontaholic ? ---> http://www.fontsanon.com
|| HTML Writers Guild ---> http://www.hwg.org
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and The Flash Film Festival
"The World�s Premier Flash Solutions Conference and Expo"
March 27-29, Nob Hill Masonic Center, San Francisco, California
-Register before Feb 25 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email help
Replies
Re: FLASH: 2 great books, but where does, Michael Penne
Re: FLASH: 2 great books, but where does, unique
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]

