Avatar of John Carney
John Carney
Flag for United States of America asked on

Trouble passing flashvars in a countdown timer

We're having a problem with a flash movie which used to produce an auction countdown timer that worked. But now it only works if we hard code the values for day, hour, minutes and seconds. Of course the four variables ahould be getting their values from the html, which I believe is getting them from a cold fusion script (about which I know virtually nothing)..

Please take a look at the code below and let me know if you can surmise from just the AS and the HTML,.what's going wrong .

I'm baffled by the fact that the original year-old swf works fine, but the one generated today from the same flash document dosn't work.

You can view the file at: http://www.discretedata.com/DealTree/CowBoomDev/00_Flash/cowboom_countdown.fla



If I could give 5,000 points for this, I would!

var day = _root.day;
var hour = _root.hour;
var minute = _root.minute;
var second = _root.second;
<OBJECT WIDTH="148" HEIGHT="33" id="cowboom_countdown" align="absmiddle">
<PARAM NAME=movie VALUE="cowboom_countdown.swf"> 
<PARAM NAME="quality" VALUE="high"> 
<EMBED src="cowboom_countdown.swf?day=4&hour=1&minute=35&second=53&textcolor=#000000&textsize=13&fontface=Arial&isBold=true" quality="high" bgcolor="FFFFFF" WIDTH="100" HEIGHT="20" NAME="cowboom_countdown" TYPE="application/x-shockwave-flash" PLUGINSPAGE="https://www.macromedia.com/go/getflashplayer" align="absmiddle"></EMBED></OBJECT>

Open in new window

Web Development SoftwareAdobe Flash

Avatar of undefined
Last Comment
Aneesh Chopra

8/22/2022 - Mon
Aneesh Chopra

John Carney

Frustarting. I still get the same error message: "Internet Explorer cannot download: Unspecified error"
Even after I changed the gloabal security settings to allow the file to connect to the internet, it still didn't work. Did you find that it produced a working countdown when you ran your swf?
Aneesh Chopra

yes, I have changed TextField style related code and after that it was working perfectly fine on my winXP sp2.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
John Carney

So you don't get the error message I get when previewing in Flash? (see attached)

Do you have the ability to test it in Vista?

Also did you make the changes to the TextField related code before or after you tested the file?  I didn't notice any changes except to the first four variables in the Frame 1 AS.

John Carney

Forgot to attach the error message
Aneesh Chopra

Did u try to execute my updated version using index.html file?

Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Aneesh Chopra

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
John Carney

Hi Aneesh,

You know I never even looked at index.html the first time around.  That works but how did you generate that page?  When I publish your flash movie, I get the html attached below.
Furthermore, the clock starts wherever I set it manually in the html code. (???). It doesn't get its days, hours minutes and seconds dynamically from some script on a server.

I still don't understand.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0',
			'width', '148',
			'height', '33',
			'src', 'cowboom_countdownAneesh2',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'cowboom_countdownAneesh2',
			'bgcolor', '#ffffff',
			'name', 'cowboom_countdownAneesh2',
			'menu', 'true',
			'allowFullScreen', 'false',
			'movie', 'cowboom_countdownAneesh2',
			'salign', ''
			); //end AC code
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="148" height="33" id="cowboom_countdownAneesh2" align="middle">
	<param name="allowScriptAccess" value="sameDomain" />
	<param name="allowFullScreen" value="false" />
	<param name="movie" value="cowboom_countdownAneesh2.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="cowboom_countdownAneesh2.swf" quality="high" bgcolor="#ffffff" width="148" height="33" name="cowboom_countdownAneesh2" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

Open in new window

Aneesh Chopra

Flash generated HTML does not includes FlashVars code automatically.
you have to add it manually,

on other hand, if you want that FlashVars values should be generated dynamically from some script on a server.

than you should have to use php or asp (server-side scripts) to embed your flash,

this way, your script will fetch the data from server/database and update the flashvars values in htmlcode dynamically while loading the flash page..