473,765 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why won't this code work?

I got this snippet online and for the life of me I can't seem to make it
write the cookie....
The Flash has the labels mentioned in the code and I used the name=movie and
the swconnect=true as mentioned in the comments.
The movie is fine.....the code is just not writing the cookie at all...
Could someone take a look and see if you can figure out why it won't work?

Thanks,

FayeC

Code as follows:
<script language="javas cript">
////////////////////////////////////////////////////////////////////////////
/////
// makeCookie is called when the page loads and only sets the cookie
// if the user does not have one.
// we can communicate with the swf by naming it in the <object> and <embed>
tags
// in the <object> tag you will see id=movie and
// in the <embed> tag i put name=movie swLiveConnect=T rue
// a list of javascript methods for flash are available at
www.macromedia.com/support/flash
// and type javascript methods into the search box
////////////////////////////////////////////////////////////////////////////
/////
function makeCookie(){
var movie = window.document .movie;
movie.StopPlay( );
// only makes the cookie if don't have one
if(document.coo kie == "") {
// play the intro
movie.Play();
// the cookie expires on this date
var date = new Date();
date.setDate(da te.getDate() + 30);
// make the cookie date readable by the browser
var da_date = date.toGMTStrin g();
var da_cookie = "visited:Tr ue" + ";expires=" + da_date;
document.cookie = da_cookie;
//uncomment the alert below to see the cookies value
//alert(da_cookie )
}

else
// if they have the cookie - fire the readIt function
readIt()
}
////////////////////////////////////////////////////////////////////////////
/////
function readIt(){
var movie = window.document .movie;
// this tells the .swf which frame to go to
// it could send any number of commands to the .swf
// send the movie to frame 3
movie.TGotoLabe l("/", "no_sound") ;
}
////////////////////////////////////////////////////////////////////////////
/////
</script>
Jul 23 '05 #1
1 1601
In article <b6************ ********@news20 .bellglobal.com >,
"FayeC" <fa**********@s ympatico.ca> wrote:
The Flash has the labels mentioned in the code and I used the name=movie and
the swconnect=true as mentioned in the comments.
I am not familiar with flash.
The movie is fine.....the code is just not writing the cookie at all...
Could someone take a look and see if you can figure out why it won't work?

// only makes the cookie if don't have one
if(document.coo kie == "") {


The variable document.cookie contains all cookies created for this
path/domain. Some other program running out of the same directory may
have created a cookie that you are not aware of.

do an alert to see what is in the cookie:

alert(document. cookie);
I suggest you use an existing set of cookie routines. see this post for
some:

http://groups.google.com/groups?hl=e...b75ff.04071407
20.7fe9333b%40p osting.google.c om&rnum=6

Re: Javascript cookies?

Here are some more lines from the post:

Here are my suggestions.

1) Always set the expiration time. IE works better.

2) You may have disabled cookies. In IE, I had to go to the site then
check whether or not cookies were enabled.

3) Maybe your cookie rountines could use improvements.

Robert
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
12927
by: Kerry Neilson | last post by:
For the past couple of months, Idle won't start when I invoke it. I am at a complete loss for why this is. When this happens, they python command line still starts, and python works fine otherwise. Most interesting to me is that a reboot won't fix the problem. But if I just try it again sometime later it will work. Anyone have any ideas? I'm running python 2.3 on windows 2000 professional.
1
1557
by: Jim | last post by:
Hey guys I DESPERATLY need some help with this small javascript i have on this website. All that it's supposed to do is change the button image once it's pressed but alas... I copy-pasted the code as it was given to me from Imageready but it won't work. The event that i wanted (and "created" with Imageready) was ondown. The code is this: ONMOUSEOUT="changeImages('company', 'Images/company.gif'); return true;"...
4
2298
by: Mark | last post by:
the Following bit of code doesn't work. It seems to respond to the second, starting with 'add iif statement for Good Practice', but not to the first, starting 'add iif statement for archived' Help me to sort this out, it has taken me almost a week to wade through and it still won't work. Select Case Forms("frmForce").OpenArgs
5
3782
by: John Warner | last post by:
I have a wierd problem that I can't find any reference to in the knowledge base. I develop simple databases at the company where I work, and many of them are used by hundreds of employees. We all have the same basic computers with the same base image. The problem is, whenever I create a hyperlink object in the database, I'm able to click on it from my PC and it works just fine. All other users click on it and Access just sits there...
7
1776
by: simon | last post by:
I have simple html(aspx) page, but vertical height won't work. Even if i had set the height of a table=100%, the table is not 100% height. I spend a lot of time(my real page is more complicated) to figured it out that this won't work because of attribute of a page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> I have visual studio 2005 beta2 and it appends this attribute to every...
3
5057
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from the network share. It loads in VS2005 fine, and I can edit and save code changes etc, but when I try and Build the solution, I get the following error... An error occured loading a configuration file: Failed to start monitoring
11
1825
by: John Ortt | last post by:
Hi everyone. I have a database which I have developed in Access 2000 which is working nicely. The problem is that my customer only has Access 97. I tried to convert the database but the main menu won't work. I has two parts, a mainmenu and a submenu which displays the option buttons.
7
11202
by: Eran.Yasso | last post by:
Hi, I have project that automate excel(using Excel COM) which works fine in my home. I took the project from my home to work and tried to build the project but it won't built. I get error "The type or namespace name 'Excel' could not be found". the error points to line in my code: "public Excel.Application ExcelObj = null".
2
2973
tpgames
by: tpgames | last post by:
Two days ago, MS office Word would type JP fonts, I thought. I didn't think I was using Works. Now, it won't type in JP. Jasc Paint shop pro 8, should type JP fonts because I am using XP, according to Corel's website, and Jasc uses whatever is in the XP font folder. But, it won't. All the JP fonts types as English, even with JP selected in the Language Bar. I can't afford to upgrade to any better paint program. I do have a free JP word...
4
2507
by: z55177 | last post by:
My domain: http://www.esthevision.cz/ This is the cause of my problem. The template is supposed to look somewhat like this: PINK STRIPE http://themebot.com/website-templates/ht... I created an extra copy of it called Natvrdo, since I modified the logo. Okay, I have this in my HTML (Natvrdo being the CSS style sheet) This is what I have in my index.html:
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.