Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
blinkluck #1
PHP to ASP to Flash
Hi
I have a countdown clock that I have built in PHP but I need to convert it to
ASP, the countdown clock changes the message based on different times on
different days of the week. The clock is based on Central Time.
-Paul
-----------PHP CODE-------------------------------
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase',
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0
,0,0',
'width', '203',
'height', '69',
'src', 'countdown',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'countdown',
'bgcolor', '#ffffff',
'name', 'mogo countdown',
'menu', 'true',
'flashvars','phpdate=<?php echo date("w.G.Y.n.j.i.s"); ?>',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'countdown',
'salign', ''
); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
rsion=9,0,0,0" width="203" height="69" id="countdown" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="flashvars" value="phpdate=<?php echo
date("w.G.Y.n.j.i.s"); ?>">
<param name="movie" value="countdown.swf" /><param name="quality"
value="high" /><param name="bgcolor" value="#ffffff" /> <embed
src="countdown.swf" quality="high" bgcolor="#ffffff" width="203" height="69"
name=" countdown" align="middle" allowScriptAccess="sameDomain"
allowFullScreen="false" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
------END OF PHP CODE------------------------------
-------------FLASH CODE-----------------------
apply.onPress = function() {
getURL ("https://www.domain.com/apply/index.asp");
}
var nextDay:String;
var addDays:Number;
var serverDateArray:Array = phpdate.split('.');
var serverDay:Number = serverDateArray[0];
var serverHour:Number = serverDateArray[1];
var serverYear:Number = serverDateArray[2];
var serverMonth:Number = serverDateArray[3]-1;
var serverDate:Number = serverDateArray[4];
var serverMinute:Number = serverDateArray[5];
var serverSecond:Number = serverDateArray[6];
if (serverDay == 0) {
// Version 1
nextDay = "Tuesday";
addDays = 2;
} else if (serverDay == 1) {
if (serverHour <= 15) {
// Version 1
nextDay = "Tuesday";
addDays = 1;
} else {
// Version 2
nextDay = "Wednesday";
addDays = 2;
}
} else if (serverDay == 2) {
if (serverHour <= 15) {
// Version 2
nextDay = "Wednesday";
addDays = 1;
} else {
// Version 3
nextDay = "Thursday";
addDays = 2;
}
} else if (serverDay == 3) {
if (serverHour <= 15) {
// Version 3
nextDay = "Thursday";
addDays = 1;
} else {
// Version 4
nextDay = "Friday";
addDays = 2;
}
} else if (serverDay == 4) {
if (serverHour <= 15) {
// Version 4
nextDay = "Friday";
addDays = 1;
} else {
// Version 5
nextDay = "Monday";
addDays = 4;
}
} else if (serverDay == 5) {
if (serverHour <= 15) {
// Version 5
nextDay = "Monday";
addDays = 3;
} else {
// Version 1
nextDay = "Tuesday";
addDays = 4;
}
} else {
// Version 1
nextDay = "Tuesday";
addDays = 3;
}
//Date([yearOrTimevalue:Number], [month:Number], [date:Number], [hour:Number],
[minute:Number], [second:Number], [millisecond:Number])
var startDate:Date = new Date(serverYear, serverMonth, serverDate, serverHour,
serverMinute, serverSecond,0);
var endDate:Date = new Date(serverYear, serverMonth, serverDate, 9, 0, 0,0);
endDate.setDate(startDate.getDate() + addDays);
this.onEnterFrame = function(){
var localDate2 = new Date();
// time difference between server time and local time
var timeDifference = Math.round((startDate.getTime() - localDate2.getTime())
/1000/3600);
startDate.setTime(localDate2.getTime() + timeDifference * 3600 * 1000); //
set my_date Date object 30 minutes forward
var days:Number = (endDate.getTime() - startDate.getTime()) / 1000 / 60 / 60
/ 24;
var days_round:Number = Math.floor(days);
var hours:Number = (endDate.getTime() - startDate.getTime()) / 1000 / 60 / 60
- (24 * days_round);
var hours_round:Number = Math.floor(hours);
var minutes:Number = (endDate.getTime() - startDate.getTime()) / 1000 / 60 -
(24 * 60 * days_round) - (60 * hours_round);
var minutes_round:Number = Math.floor(minutes);
var seconds:Number = (endDate.getTime() - startDate.getTime()) / 1000 - (24 *
60 * 60 * days_round) - (60 * 60 * hours_round) - (60 * minutes_round);
var seconds_round:Number = Math.round(seconds);
if (seconds_round<10) { s = "0"+seconds_round; } else{s = seconds_round;}
if (minutes_round<10) { m = "0"+minutes_round; } else {m = minutes_round;}
if (hours_round<10) { h = "0"+hours_round; } else {h = hours_round;}
timeleft.text = (Number(h)+(days_round*24))+":"+m+":"+s;
serverdate.text = "counting down the days "+nextDay+".";
}
--------------------END OF FLASH CODE
blinkluck Guest
-
Flash player not working on some websites & have foundRegestry keys of older Flash players.
Hi, like many people here I have problems seeing flash content on some websites but other websites work fine. I also found that YOUTUBE works... -
Flash player installed, but every site flash playerrequired for asks to install not working at all
Hi all, wondering if someone would be kind enough to help me, PLEASE lol Flash player asks to be installed everytime I go onto any site that... -
Javascript news ticker + Flash = shaking Flash inFirefox?
I'm moving content (which I didn't develop) from an old site to my new design. I've run across a strange issue where a javascript menu appears to be... -
Calling on the Flash gurus!! How do I bring in a multi-page PDF into Flash?
Hello, I think this may be new territory, well for me at least. I am trying to IMPORT a cable drawing package (PDF with over a hundred pages)... -
convert all flash site to both flash and no flash
a friend has a site that is done with all flash. they asked me to help make it readable by more browsers. could some belly point me in the right...



Reply With Quote

