Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 489
  • Last Modified:

Annoying Music in flash movies.

Can flash be programmed so that when a person clicks a "no sound" or "sound off" button on one flash movie that it knows not to load the music again...

I'm not sure how this would be achieved unless a cookie of some type could be read into the movie.

It would be cool for the movie to remember (last time you were here you turned off the music so don't play it this time)

Trudy
0
trudymaresch
Asked:
trudymaresch
  • 28
  • 23
1 Solution
 
thor918Commented:
Hi Trudy, what version of flash are you developing with?
You could use cookies like this, using javscript ->
Example :
http://hammar.no/users/thor/submit/passcookie.html
Source :
http://hammar.no/users/thor/submit/passcookie.fla
http://hammar.no/users/thor/submit/passcookie.swf

But if you have the new flash mx.. Fetching cookies are builtin :D so you don't need javascript.. you can do it directly with flash using "local Shared Object"..
Read here:
http://www.macromedia.com/support/flash/ts/documents/local_so.htm

Hope this helps you ;)
Best regards
Thor
0
 
thor918Commented:
one little thing.. The flash needs a little delay to get the cookie from the javascript to flash... my example have a a very small delay.. so that it may not work all the time.. Try adding a longer delay.. or you could make the flash wait for the javascript to pass a "okey" string back..
0
 
thor918Commented:
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
thor918Commented:
0
 
trudymareschAuthor Commented:
I am using Flash 5.
0
 
thor918Commented:
and in the first example.. If you want the sound to stop quickly when you press the stop button.. you can change the action script to set the volum instead :

tellTarget ("music") {
  stop (); //stop playing the movieclip with sound
}

replace with :

tellTarget ("music") {
 musicobj=new Sound(music);
 musicobj.setVolume(0); //sets the volume off
}


and if you are looking on how to implant a sound look at this Tutorial : http://www.flashkit.com/tutorials/Audio/Sound_Vo-Sanjeevi-469/index.shtml
0
 
thor918Commented:
huh made an error in the post..

The on button action script :
on (release) {
     tellTarget ("music") {
       gotoAndPlay ( 2 ); //start playing the movieclip with sound and jump over the stop action script in first frame
     }
       musicobj=new Sound(music);
       musicobj.setVolume(100); //sets the volume off

  musicstate = "on";//setting dynamic text field
  fscommand ("writesound", musicstate); //sending a command to javascript.. and javascript then writes a cookie
}

the off button action script :
on (release) {
      musicobj=new Sound(music);
      musicobj.setVolume(0); //sets the volume off
  musicstate = "off";//setting dynamic text field
  fscommand ("writesound", musicstate); //sending a command to javascript.. the javascript then writes a cookie
}

0
 
trudymareschAuthor Commented:
This looks really good- I'm going to try to get it to work on my movie now.

I'll let you know how it goes.
0
 
trudymareschAuthor Commented:
Does this need an On & Off button?  The movies loads with the music in a "ON" status. So if they turn it off, reload the page with it off - they need to turn it back on. - How do I only show 1 button for this.
0
 
thor918Commented:
:D Sorry about the bad sound clip in my example.. hehe I just took one of the sounds that follows the "flash 5"

I'm looking forward to hear how it goes ;)
0
 
trudymareschAuthor Commented:
Forget that last question, I can put "turn music back on" button on the next frame.... with the different actionscript.
0
 
trudymareschAuthor Commented:
For this movie, if the cookie could tell the movie where to start playing from instead of adjusting the volume this would work better for my movie.
0
 
thor918Commented:
okey.. I will give you the code anyway.. Here is one button with on and off

on (release) {
if(musicstate == "off"){
//the on code start
     tellTarget ("music") {
       gotoAndPlay ( 2 ); //start playing the movieclip with sound and jump over the stop action script in first frame
     }
       musicobj=new Sound(music);
       musicobj.setVolume(100); //sets the volume off

  musicstate = "on";//setting dynamic text field
  fscommand ("writesound", musicstate); //sending a command to javascript.. and javascript then writes a cookie
//the on code end
}else{
//the off code start
      musicobj=new Sound(music);
      musicobj.setVolume(0); //sets the volume off
  musicstate = "off";//setting dynamic text field
  fscommand ("writesound", musicstate); //sending a command to javascript.. the javascript then writes a cookie
//the off code end
}
}
0
 
thor918Commented:
okey.. but start playing where.. in the main timeline or in one of the movie clips?
0
 
trudymareschAuthor Commented:
Okay - I hope I can get it to work...

Thanks!
0
 
trudymareschAuthor Commented:
Still back on your previous answer - witht he new code you've shown for a 1 button movie
0
 
trudymareschAuthor Commented:
Which page example should I look at for the javascript?
0
 
thor918Commented:
http://hammar.no/users/thor/submit/passcookie.html

here is the html&javascript->
<HTML>
<HEAD>
<TITLE>loadtext</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
//******************************************************************************************
//These are variables you must set. In order to get the FSCommand to work in Flash, YOU MUST
//also add the NAME parameter to the EMBED tag and the ID parameter to the OBJECT tag. These
//two must be the same and match the "moviename" variable. They DO NOT have to match the name
//of your Flash movie. Look at the bottom of this file.
var moviename = "thenameofyourmovie";
var flashInputVar = "Filename";
// Created by Kent Del Castillo - http://www.kentd.com - kent@kentd.com
// Modified by Thor Selnes thor918@online.no
//******************************************************************************************

function thenameofyourmovie_DoFSCommand(command, args){
      if(command == "writesound"){ // writes a cookie from flash
           SetCookie("soundstate", args);//setts the cookie
      }
       if(command == "readsound"){ // read off the sound state and pass it to flash
         var soundstatecookie = GetCookie("soundstate"); //getting the cookie
         if(!soundstatecookie){soundstatecookie="off";}//the cookie is not set and the default value is to have the sound turned off in the flash
         movieobject(moviename).SetVariable("musicstate", soundstatecookie); //pass a variable back to flash
      }

}

function movieobject(moviename)
{
//IE and Netscape refer to the movie object differently.
//This function returns the appropriate syntax depending on the browser.

      if (navigator.appName.indexOf ("Microsoft") !=-1)
      {
      return window[moviename]
      }
      else
      {
      return document[moviename]
      }
}

//COOKIE CODE BELOW
var expDays = 365; // number of days the cookie should last

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg) {    
return getCookieVal (j);   }
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;  
}  
return null;
}
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
movieobject(moviename).SetVariable(fullVar, "");
}
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

// End -->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
<!--
//  Catch FS Commands in IE, and pass them to the corresponding JavaScript function.
Sub thenameofyourmovie_FSCommand(ByVal command, ByVal args)
    call thenameofyourmovie_DoFSCommand(command, args)
end sub
//-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#FFFFFF">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
 WIDTH=550 HEIGHT=400 ID="thenameofyourmovie">
 <PARAM NAME=movie VALUE="passcookie.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED NAME="thenameofyourmovie" src="passcookie.swf" quality=high bgcolor=#FFFFFF  WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</BODY>
</HTML>

0
 
thor918Commented:
Do you need more help? just ask :D
0
 
trudymareschAuthor Commented:
Javascript working, movie working, however cookie not working - any ideas
0
 
thor918Commented:
You can by the way remove this from the script..
var flashInputVar = "Filename";

It is not needed;)
0
 
thor918Commented:
have you changed anything in the html/javascript? if so post it..
0
 
trudymareschAuthor Commented:
The only thing I changed was the moviename variable


<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
//******************************************************************************************
//These are variables you must set. In order to get the FSCommand to work in Flash, YOU MUST
//also add the NAME parameter to the EMBED tag and the ID parameter to the OBJECT tag. These
//two must be the same and match the "moviename" variable. They DO NOT have to match the name
//of your Flash movie. Look at the bottom of this file.
var moviename = "nodiamonds";
var flashInputVar = "Filename";
// Created by Kent Del Castillo - http://www.kentd.com - kent@kentd.com
// Modified by Thor Selnes thor918@online.no
//******************************************************************************************

function nodiamonds_DoFSCommand(command, args){
     if(command == "writesound"){ // writes a cookie from flash
           SetCookie("soundstate", args);//setts the cookie
     }
      if(command == "readsound"){ // read off the sound state and pass it to flash
         var soundstatecookie = GetCookie("soundstate"); //getting the cookie
         if(!soundstatecookie){soundstatecookie="off";}//the cookie is not set and the default value is to have the sound turned off in the flash
         movieobject(moviename).SetVariable("musicstate", soundstatecookie); //pass a variable back to flash
     }

}

function movieobject(moviename)
{
//IE and Netscape refer to the movie object differently.
//This function returns the appropriate syntax depending on the browser.

     if (navigator.appName.indexOf ("Microsoft") !=-1)
     {
     return window[moviename]
     }
     else
     {
     return document[moviename]
     }
}

//COOKIE CODE BELOW
var expDays = 365; // number of days the cookie should last

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg) {    
return getCookieVal (j);   }
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;  
}  
return null;
}
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
movieobject(moviename).SetVariable(fullVar, "");
}
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

// End -->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
<!--
//  Catch FS Commands in IE, and pass them to the corresponding JavaScript function.
Sub nodiamonds_FSCommand(ByVal command, ByVal args)
    call nodiamonds_DoFSCommand(command, args)
end sub
//-->
</SCRIPT>
0
 
trudymareschAuthor Commented:
Now - there is a javascript error??
0
 
trudymareschAuthor Commented:
On page load errors:

line 38
Char 4 expected ';'

then

line 125
Char 4
Error - Type Mismatch 'thenameofyourmovie_doFSCommand'

and same error when I click soundoff


0
 
thor918Commented:
hmm I can't see why.. but I changed the movie name myself and It worked :
<HTML>
<HEAD>
<TITLE>loadtext</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
//******************************************************************************************
//These are variables you must set. In order to get the FSCommand to work in Flash, YOU MUST
//also add the NAME parameter to the EMBED tag and the ID parameter to the OBJECT tag. These
//two must be the same and match the "moviename" variable. They DO NOT have to match the name
//of your Flash movie. Look at the bottom of this file.
var moviename = "nodiamonds";
// Created by Kent Del Castillo - http://www.kentd.com - kent@kentd.com
// Modified by Thor Selnes thor918@online.no
//******************************************************************************************

function nodiamonds_DoFSCommand(command, args){
      if(command == "writesound"){ // writes a cookie from flash
           SetCookie("soundstate", args);//setts the cookie
      }
       if(command == "readsound"){ // read off the sound state and pass it to flash
         var soundstatecookie = GetCookie("soundstate"); //getting the cookie
         if(!soundstatecookie){soundstatecookie="off";}//the cookie is not set and the default value is to have the sound turned off in the flash
         movieobject(moviename).SetVariable("musicstate", soundstatecookie); //pass a variable back to flash
      }

}

function movieobject(moviename)
{
//IE and Netscape refer to the movie object differently.
//This function returns the appropriate syntax depending on the browser.

      if (navigator.appName.indexOf ("Microsoft") !=-1)
      {
      return window[moviename]
      }
      else
      {
      return document[moviename]
      }
}

//COOKIE CODE BELOW
var expDays = 365; // number of days the cookie should last

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg) {    
return getCookieVal (j);   }
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;  
}  
return null;
}
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
movieobject(moviename).SetVariable(fullVar, "");
}
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

// End -->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
<!--
//  Catch FS Commands in IE, and pass them to the corresponding JavaScript function.
Sub nodiamonds_FSCommand(ByVal command, ByVal args)
    call nodiamonds_DoFSCommand(command, args)
end sub
//-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#FFFFFF">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
 WIDTH=550 HEIGHT=400 ID="nodiamonds">
 <PARAM NAME=movie VALUE="passcookie.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED NAME="nodiamonds" src="passcookie.swf" quality=high bgcolor=#FFFFFF  WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</BODY>
</HTML>
0
 
trudymareschAuthor Commented:
I changed it back to "thenameofyourmovie" and got the same errors, are you using the "one button" actionscript?
0
 
thor918Commented:
have you changed the embed name and the object id to nodiamonds? try my last post instead..
0
 
trudymareschAuthor Commented:
I will cut and past your last post see what happens.
0
 
trudymareschAuthor Commented:
I still get the javascript errors.... I'm surprised your aren't?!?
0
 
trudymareschAuthor Commented:
I'm going to try the javascript from this

http://hammar.no/users/thor/submit/passcookie.html

I didn't get the error on this one.

0
 
trudymareschAuthor Commented:
Okay did that now the first script error is gone, but I now get

line 37
Char 10
undefined is null or not an object.
0
 
thor918Commented:
Hmm..wait.. I will try to rewrite the code
0
 
trudymareschAuthor Commented:
I'm going to try and use the code I found in the passcookie.fla

At least I know this one works...

I will have to reverse the code in this as the file loads with the music on.

Trudy
0
 
thor918Commented:
have you tested out the new files?
0
 
trudymareschAuthor Commented:
Hey its cool - I have to revise my movie because I have only allowed for 2 frames in the main scene and the text only shows up when you mouseover the music icon.

It might take me a few hours to revise the entire file.  I'll let you know.
0
 
thor918Commented:
okeydoki..
0
 
thor918Commented:
A good idea is to clear the cach when you are try to make a new swf.. When I tested with the new flash.. the old swf was displayed instead..I had to clear the cach first.

In internet explorer ->
"Goto tools"_"temporary Internet files"_"Delete files"_"Delete offline content"

Have you made it work now?
0
 
thor918Commented:
There is a errror in the javascript.. The cookies are not written.. sorry.I will post a fix when I get back home.
0
 
thor918Commented:
I have uploaded a fix now.. I forgot something with the expire date.. so the cookie expiered at once the browser was restarted..

Here is the html/javascript fixed:
<HTML>
<HEAD>
<TITLE>loadtext</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
//******************************************************************************************
//These are variables you must set. In order to get the FSCommand to work in Flash, YOU MUST
//also add the NAME parameter to the EMBED tag and the ID parameter to the OBJECT tag. These
//two must be the same and match the "moviename" variable. They DO NOT have to match the name
//of your Flash movie. Look at the bottom of this file.
var moviename = "nodiamonds";
// Created by Kent Del Castillo - http://www.kentd.com - kent@kentd.com
// Modified by Thor Selnes thor918@online.no
//******************************************************************************************
function nodiamonds_DoFSCommand(command, args){
      if(command == "writesound"){ // writes a cookie from flash
           var exp = new Date(); //getting date
           exp.setTime(exp.getTime() + (expDays*24*60*60*1000));//setting expire date
           SetCookie("soundstate", args,exp);//setts the cookie
      }
       if(command == "readsound"){ // read off the sound state and pass it to flash
         var soundstatecookie = GetCookie("soundstate"); //getting the cookie
         if(!soundstatecookie){soundstatecookie="off";}//the cookie is not set and the default value is to have the sound turned off in the flash
         movieobject(moviename).SetVariable("soundstatecookie", soundstatecookie); //pass a variable back to flash
      }

}

function movieobject(moviename)
{
//IE and Netscape refer to the movie object differently.
//This function returns the appropriate syntax depending on the browser.

      if (navigator.appName.indexOf ("Microsoft") !=-1)
      {
      return window[moviename]
      }
      else
      {
      return document[moviename]
      }
}

//COOKIE CODE BELOW
var expDays = 365; // number of days the cookie should last

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg) {    
return getCookieVal (j);   }
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;  
}  
return null;
}

function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}

function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

// End -->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
<!--
//  Catch FS Commands in IE, and pass them to the corresponding JavaScript function.
Sub nodiamonds_FSCommand(ByVal command, ByVal args)
    call nodiamonds_DoFSCommand(command, args)
end sub
//-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#FFFFFF">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
 WIDTH=550 HEIGHT=400 ID="nodiamonds">
 <PARAM NAME=movie VALUE="new_passcookie.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED NAME="nodiamonds" src="new_passcookie.swf" quality=high bgcolor=#FFFFFF  WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</BODY>
</HTML>
0
 
trudymareschAuthor Commented:
Hi thor918,
I've run into a little problem with my flash and I am trying to reinstall... I haven't been able to try the new javascript yet, my .swf file somehow became corrupt so I couldn't even use it. I am working on it, I'll let you know hopefully later today.

Trudy
0
 
thor918Commented:
Hei again..
I have upload the fla with a modification..
I added a delay before the fscommand is sent..
The reason is that the javascript sometimes doesn't get the command.. Now it gets the cookie all the time :D

Sorry for all the fixes.I hope you can get it to work now..

http://hammar.no/users/thor/submit/new_passcookie.html
http://hammar.no/users/thor/submit/new_passcookie.fla
http://hammar.no/users/thor/submit/new_passcookie.swf
0
 
trudymareschAuthor Commented:
Thanks, I'll have a look, I was just able (now) to get flash back up and running without errors.

Hopefully I will be able to get back to this tomorrow...
again many thanks for your help.

Trudy
0
 
thor918Commented:
:D at least now I'm pretty sure that the cookie thing is working.. at least in Internet exploerer.. I haven't got it working with netscape..but it should work
0
 
trudymareschAuthor Commented:
I wish everyone would stop using Netscape - it's a pain for people like us!  Still working out the frames.
0
 
thor918Commented:
All this standards and browsers(own standards) makes all webthings a bit complicated.. I wished all could use the same standard.. it would make all much easier ;)

Do you have some kind of server side scripting feature on you server?
0
 
thor918Commented:
http://www.macromedia.com/support/flash/ts/documents/mozilla_fscommand.htm

it seems that netscape6 and mozilla dosen't even support fscommand.. the fscommand is a must for communicating out of the flash..

But the code shold be able to run on older versions of netscape... I havent made it work on my netscape4.08.. perhaps it's to old.. I don't know

I recomend if your visitors uses varies of browsers,, the best thing to do is to upgrade to flash mx..where you don't need javascript to write cookies.
0
 
trudymareschAuthor Commented:
If they have netscape and the cookie isn't working, as long as an error isn't generated in Netscape, I don't care.  Most visitors are still using Internet Explorer.  

Upgrading to Flash mx is not an option at this time (unless its free), but I will keep it in mind for future fscommand problems.

I still haven't been able to get my code to work only because I have run out of time today.  I will hopefully get back to it tomorrow.  I am accepting your answer at this point in any event, but I hope I can count on you if I run into any more problems (ie if netscape produces an error)
0
 
thor918Commented:
You can count on me :D
Thanks for the points and the grade A :D
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 28
  • 23
Tackle projects and never again get stuck behind a technical roadblock.
Join Now