View Full Version : I need a clean exit from Flash 5
onqchris
03-10-2006, 08:04 PM
I have inserted a button that allows the user to leave my Flash 5 developed website. The action script attached to the button is
on (release) {unloadMovieNum (0); fscommand ("quit");}
Although a successful exit is made, instead of returning the user to the originating web browser page, the user is presented with a blank page requiring the additional use of the Browser's <-Back button.
Is there somebody out there who can advise me of the correct action script that I need in order to get a clean Exit from my website.
Maybe it cannot be done.
If it helps, my website is www.oxalor.co.uk
oldnewbie
03-10-2006, 08:44 PM
First the unloadMovieNum(0) action is enough, the fscommand one is useless online, and is only used for local projector files...
You could try unloading the movie and use a javascript location call with the history parameter, but don't know if both would in fact be executed...
onqchris
03-11-2006, 06:19 PM
I am no expert in the use of Flash 5 but manage to get by. I knew that the fscommand action script was unnecessary for online but have been developing the online version and a movie version in parallel.
I have no knowledge of Javascript.
Is it possible that you could help this old man out a bit by being a little more precise. I have looked it up on the internet and the javascript that I think I need is history.back() but where do I put it?
I need to be able to simply click on my exit button to leave the movie and do the equivalent of a further click on the web browser's <-Back button.
Is this possible?
oldnewbie
03-11-2006, 09:50 PM
Just tried it, but as I thought, after an unloadMovieNum action, the second javascript call is never executed.
onqchris
03-12-2006, 01:13 PM
Thank you, oldnewbie, for your help - you are being a real Pal.
I would like to experiment a little but being a dumbo, as far as javascript is concerned, perhaps you could help just a little more.
I know that this probably will not work but I can be reasonably inventive (for an old man) and maybe with a combination of things I might very well end up achieving the result that I need.
Do I insert javascript in the Flash 5 run scripts? For example on (release) {history.back(); unloadMovieNum (0);} or whatever, or does the javascript go somehere else outside of Flash 5?
What code did you use during your experimentation?
onqchris
03-12-2006, 09:35 PM
I have come up with an idea that 'almost' works - I have created an exit button in my Flash 5 *.swf file that calls a simple HTML file -
<HTML>
<HEAD>
<TITLE>BlankTest</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<A HREF="javascript:history.go(-2)">[text]</A> etc.
This still requires the viewer to click on the narrative [text] which then takes you back two steps in history. In my case, back to Google.
What I need is for the JavaScript to automatically do that without the need to 'click'.
What is the JavaScript statement that I need to accomplish this?
onqchris
03-13-2006, 10:06 AM
When I exit from my Flash 5 website I am left with a blank screen which requires the use of the browser's <-Back button to return to the original starting point (in my case Google).
I have come up with the idea of creating a dummy HTML file and redirecting my website Exit button to it. The idea being that the JavaScript in my dummy HTML file will automatically take me back in history to Google.
The idea that 'almost' works -
<HTML>
<HEAD>
<TITLE>BlankTest</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<A HREF="javascript:history.go(-2)">[text]</A> etc.
This still requires the viewer to click on the narrative [text] which then takes you back two steps in history. In my case, back to Google.
What I need is for the JavaScript to automatically do that without the need to 'click'.
Has anybody out there got the solution?
cptn_spoon
03-13-2006, 01:08 PM
I'm not sure if it would work but you could always try enclosing it in the location.replace() function which is the usual way you would redirect through JS.
<head>
<script language="javascript">
location.replace(history.go(-2))
</script>
</head>
onqchris
03-13-2006, 05:53 PM
Thank you cptn spoon!
Your suggestion did not quite work but it pointed me in the right direction -
<head>
<script language="javascript">
history.go(-2)
</script>
</head>
This works!!!!!
Great!!!!
Thank you!!!!
|
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.