Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | FLASH: Flash variable sans FSCommands |
From: | Gahlord Dewald |
Date: | Thu, 5 Oct 2000 16:49:32 +0100 |
Renu: you have the exchange the [enter name] part of the url with a name.
For anyone just getting into this thread, the URL under discussion is:
http://www.weedsmedia.com/cards/birthday/bdaymoper.htm?bd=[enter name]
IMPORTANT:
If you don't replace [enter name] with something lowercase you will get the
problem Renu mentioned earlier. Also, the number of chars should be limited (but
I did try it with a number of longer names, like Jebediah)
On 10/5/00 at 11:05 AM, Paul Willoughby <paul_willoughbybeap [dot] co [dot] uk> wrote:
> That's a really cool idea! Works fine for me (PIII, IE5.5, F5 player, T3,
> NT), although it's pretty limited i.e. a name longer than about 5 characters
> won't display properly, you can't add spaces to a name unless you know %20
> is a space etc.
Yeah I'll admit that it is a little limited but that's the way it goes when
you're just pumping it together. It also insists on all lowercase letters (the
uppercase of Copal is just a gigando version and would limit the chars even
more). I do have to note that a name longer than 5 chars is possible (I tested
it on my friend hathalee and it worked).
> Did you really not have to use FSCommand? How does Flash get the variable
> from the URL string?
I did a lot of reading. ;) No seriously, the actual frameset holding the flash
movie itself is commented with all the sources of code I stole. But the short
form is:
Background info:
Thanks to some swell folks on this list (who have open invites to beer and my
couch in beautiful Burlington Vermont) I learned that if you replace the name
portion of your movie in the html (the bday.swf part) with something like
(bday.swf?bd=paul) the variable will get passed when the swf loads, no
FSCommands needed. You will note that this is kind of limited for extensive
html/flash communiques because the variable only loads once (when the swf loads)
and Flash can't talk back to the html in a fully dynamic manner (sure it could
post to a txt file or something, but what happens when 8 people log in at once;
plus, server side scripting sucks). So with that knowledge, proceed.
I run a javascript query (that I don't fully understand, I just cut out the
parts I needed) that I got from the javascript code library at webmonkey. That
query reads the URL of this.location. Then it runs a little script that saves
everything after the "?" as a variable (called, bd_name or something I can't
remember right now).
then:
I do a document.write to print all the javascript (which I stole from Colin
Moock's cookie setting javascript, which is another way to pass a variable
without an FSCommand, I didn't want to set a cookie though). The document.write
stuff takes near the name of the movie to have a + bd_name + blah blah blah.
that line looks like this:
document.write(
...all the param stuff before the movie name...
+ "<PARAM NAME=MOVIE VALUE=b-day.swf?" + bd_name +">"
...all the stuff following the movie name (don't forget to repeat something like
this when you get to the other spot where the swf is called)...
Now it gets just a little trickier because I have the whole damn thing in a
frameset to keep things automatically centered. What I do is run the query stuff
on the frameset page, then print the frameset with a document.write and add the
?bd=yournamehere to the html page that actually holds the swf. Confusing? I'll
list all the html pages so you can all go grab the source.
And voila, when the flash is loaded, it has the variable. I'm thinking of making
a little html page where people can send an email to their friends and never
have to mess with knowing the whole ?=blah thing. Maybe after I do that I'll
cook up a whole tutorial on it. Sure it's pretty simple and all but there's a
lot that could be done with it, mostly just little fun things but hey, it's the
web right? And I've found it to be a great little foray into the joys and pains
of javascript and flash. If I weren't so adamant about not losing IE on the mac
I'd say there was a _lot_ of power there.
the _real_ code is at (I'll be moving the comments out to the frameset shortly,
it was a last minute thing to put it all in a frameset):
http://www.weedsmedia.com/cards/birthday/bday_r2_1.htm?bd=test
the frameset is at:
http://www.weedsmedia.com/cards/birthday/bdaymoper.htm?bd=daniel
the blank pages for spacing the frameset are at:
http://www.weedsmedia.com/cards/birthday/blank1.htm
>
>
> hth
>
> Paul
>
>
>
> >>Gahlord Dewald wrote on 04 October 2000 22:40
> I've been messing around with some javascript and Flash stuff. I made a
> quick
> birthday card that is customizable without FSCommands (so it works on mac
> IE).
>
> I'm looking for comments on:
> Does it work at all?
> Does the customizable type get totally screwed up (I didn't use a true
> type)?
> Should I whip up some kind of pre-loader disguised as credits or something?
> Should I not kill the sound so much while compressing?
>
> I'm not very interested in:
> Comments on visual aesthetics; I just whipped this thing out to test a code
> idea.
>
> the url is:
>
> http://www.weedsmedia.com/cards/birthday/bdaymoper.htm?bd=[enter name here]
>
> replace [enter name here] with your own name or someone else's name or
> whatever,
> like so:
>
> http://www.weedsmedia.com/cards/birthday/bdaymoper.htm?bd=gahlord
>
>
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> NudeGuru.com is proud to sponsor the Flasher list
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> IT'S THE ART OF MONEY, HONEY!
> Tips and Advice from some of the most popular Flash
> artists + industry power-brokers on how to hold onto
> your rights, negotiate contracts and get full value
> for your work.http://www.nudeguru.com from Franke James
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> To unsubscribe or change your list settings go to
> http://www.chinwag.com/flasher or email helpchinwag [dot] com
>
Gahlord Dewald
Weeds Media Consortium
Hoops of Fire. Dancing Bears.
Interactive Designers.
http://www.weedsmedia.com
v: 802.658.4267 x 1
f: 800.863.9606
e: gahlordweedsmedia [dot] com
Weeds Media Consortium
416 Pine Street
Burlington, VT 05401
USA
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NudeGuru.com is proud to sponsor the Flasher list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IT'S THE ART OF MONEY, HONEY!
Tips and Advice from some of the most popular Flash
artists + industry power-brokers on how to hold onto
your rights, negotiate contracts and get full value
for your work.http://www.nudeguru.com from Franke James
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
RE: FLASH: Site Test: JS/Flash, Paul Willoughby
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]