View Full Version : hover ad with cookies
petersruby
09-18-2007, 03:39 PM
I've created a Flash movie ad that hovers over my home page. I want the Flash movie to only appear once for a user each day. Does anyone know a script that I can either place in my HTML, or a string that I can embed in my Flash movie that will accomplish this?
Thanks.
jscheuer1
09-18-2007, 04:50 PM
Javascript can be used for that. How exactly would depend upon how your hovering Flash content is triggered to begin with.
Server side code could (requires host support) or Flash code might be able to be used, and either of these would be a better approach, because javascript isn't available to all users, and of those who have it, javascript cookies are not always reliable, or necessarily enabled. However, I am not as familiar with those other approaches.
Most users would have both javascript and javascript cookies enabled, but could still delete or edit their cookies, if they so chose, to change whether or not they were to see the hovering content. This is a bit unusual, but can be done by users 'in the know'. Some few browsers will be configured to delete all javascript cookies upon exit.
There is no 'HTML only' code for something like that.
A link to your live page with the hovering Flash content would help me to determine how to implement a javascript solution.
It would be easier to do it either once per each 24hrs beginning with each time it does appear for a given user, or once per browser session. A browser session begins when the browser is opened for the first time and ends when all instances of that browser are closed (exited). But a cookie could be set up to check both the time and the day number, however this would allow for a user to experience the hovering content twice in a row if they logged onto the site just before midnight (user's time) on any given day.
Another consideration with javascript is what to do with non-javascript enabled browsers. In that case, do you want to show the hovering content always (would require it to have a Flash method for dismissing it), or never?
petersruby
09-18-2007, 07:26 PM
Thanks for the suggestions. I think I'd definitely like to figure out a way to do it without Javascript, because of the reasons you mentioned. I am the host for the site, so any serverside scrips are not a problem.
But, if we did go with the Javascript option, I like the idea of having the Flash appear once per each 24hrs beginning with each time it does appear for a given user, and if users don't have a Javascript enabled browser, then I'd like the Flash to show up always.
Here's the test page (http://www.timesshamrockcommunications.com/banners/cookietest/html/demo_.html)
Thanks again
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.