Last Updated on March 6, 2001
Q: I would like to know if there is a way to have a flash movie and then
when it is over make it transition into another website (homepage)
without having the viewer have to click on a button or anything? Thanx.
A: Yes. Have a look at this example: auto-forward.swf auto-forward.fla
Q: It's a good thing Google indexed your page already, I've been trying
to do this for weeks with no luck :o( Basically I just want to be able
to send some variables from CGI to Flash. I understand already how to use
Load Variables to *send* the form data variables to CGI but I don't know
how to make the script output back to Flash instead of HTML. This is my
problem: If I want CGI to write to HTML I can set the MIME type with
print "Content-type: text/html\n\n";
and then just use print ""; to output everything else.. But how do I
make the CGI output to Flash instead? I hope this question makes sense.
Also, I have to send the variables using POST instead of GET because it
is a very long string. I'm told that using GET is quite easy, but I have
to use POST. Any ideas?
A: To get the variables to be "read-in" by flash after you output from
your cgi script, use the loadvariables function as shown here in this
example: cgi-sample2.swf cgi-sample2.fla
C: I stumbled across your tutorial on using Flash 5 with CGI while
searching for an answer to my problem of text fields appearing with "[text
Function]" pre inserted into them. In your tutorial under the bugs section,
you mention this bug. Well, after many hours of examining my movie I finally
realized that I had unwittingly named my text field variable the same name
as a function I had set up earlier, and they were conflicting. I solved the
problem by just renaming my text field variable to something else. Just
thought you might want to know that it was not a bug.
Also, I just thought, this preset entry probably exists so you can set
a text field variable to the name of a function and have the function return
a value for it. I am still fairly new to actionscript so I don't know for
sure if this is possible, but it sounds like that is the case.
Sincerely,
Mike
Q: Thank you very much for writing such helpful material on sending Flash
variables to a CGI script. Thanks to you I've got a form-to-mail script
working, sort of! When the Get URL is called from the top layer of the movie
everything's fine, and all the variables get posted, but I've got my form in
a container movie clip that only becomes visible when needed, and putting
the GET URL button in the movie container doesn't send all of the variables.
Can you help at all?
Thanks again,
Phil Balderson
A: If you only want to send all of the variables without receiving any
information back to Flash, you can use the geturl function. You have to
use the "loadvariables" function instead of the "geturl" function. When
you want to post other variables to the CGI script that are not in the movie
you are calling the "geturl" function, you must first copy them from the
locations in your other movies to that movie that contains the "geturl"
function. You just put a "/" along with a ":" and the instance movie name
that the variable is contained in such as "/name:" and the variable you want
to get the value of such as "/name:variable" to access variables outside of
the movie you are working on. If the variable you want to access is
contained in the main container movie, use a "/:variable" to access it.
This lets you post variables in movies outside of the movie you are working
on to the CGI. Once you accessed the outside variable, then copy its
contents to another variable in that movie that contains the "geturl"
function. This will allow you to post all the variables you want to.