Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
swf clocks + javascript
Old 07-17-2010, 05:14 AM swf clocks + javascript
Junior Talker

Posts: 1
Trades: 0
Hi,

I would like to have the same running clocks as on page: http://marketindex.rbs.com/uk/Home.aspx

I looked what is the source code of that page by downloading the page and to show swf object it is:
PHP Code:
<OBJECT type="application/x-shockwave-flash" data="http://marketindex.rbs.com/media/swf/clocks.swf" width="237" height="80" id="homeclocks" style="visibility: visible; ">
<
PARAM name="wmode" value="transparent">
<
PARAM name="flashvars" value="city1=Tokyo&amp;city2=Frankfurt&amp;city3=London&amp;city4=New York&amp;ampm1=PM&amp;ampm2=PM&amp;ampm3=PM&amp;ampm4=AM&amp;hours1=22&amp;hours2=15&amp;hours3=14&amp;hours4=9&amp;minutes1=54&amp;minutes2=54&amp;minutes3=54&amp;minutes4=54"></OBJECT
When i put this code on my webpage with proper swf link on my hosting i can display these clocks but they are not running.
(i can only see swf file in Google Chrome and Firefox, it does not show in Explorer, why?)

I think to have these clocks running i also have to use javascript. In that source code i see it has

PHP Code:
<SCRIPT language="javascript" src="./Homepage_files/Website.Lib.js" type="text/javascript"></SCRIPT> 
and it uses 'function Clock' from that file.

Below swf object there is another javascript:

PHP Code:
<SCRIPT language="javascript" type="text/javascript">
var 
clock;
$(function() {
 
clock = new Clock(17,38);
 
clock.cities[0] = ["Tokyo",7]; 
 
clock.cities[1] = ["Frankfurt",0]; 
 
clock.cities[2] = ["London",-1]; 
 
clock.cities[3] = ["New York",-6]; 
 
clock.Tick();
});
</SCRIPT> 
So i put all lines to my php file: http://www.emy.pl/clocks.php to try if it is running. My code is:

PHP Code:
<html
<
head
<
script language="javascript" src="http://www.emy.pl/Website.Lib.js" type="text/javascript"></script> 
</head> 
 
 
<body> 
<object style="visibility: visible;" id="homeclocks" data="clocks.swf" type="application/x-shockwave-flash" height="80" width="237"> 
<param value="transparent" name="wmode"> 
<param name="movie" value="clocks.swf"> 
<PARAM name="flashvars" value="city1=Tokyo&amp;city2=Frankfurt&amp;city3=London&amp;city4=New York&amp;ampm1=PM&amp;ampm2=PM&amp;ampm3=PM&amp;ampm4=AM&amp;hours1=23&amp;hours2=16&amp;hours3=15&amp;hours4=10&amp;minutes1=37&amp;minutes2=37&amp;minutes3=37&amp;minutes4=37"> 
</object> 
 
<script language="javascript" type="text/javascript"> 
var clock; 
$(function() { 
   clock = new Clock(17,38); 
   clock.cities[0] = ["Tokyo",7]; 
   clock.cities[1] = ["Frankfurt",0]; 
   clock.cities[2] = ["London",-1]; 
   clock.cities[3] = ["New York",-6]; 
   clock.Tick(); 
}); 
</script> 
 </body> 
</html> 
And when i put proper hours and minutes in line: clock = new Clock(17,38);
it does work, clocks are running, but when i reload page it shows the same time 17,38 and starts running from that time.

Can someone help me with that code?

Thank you!
delta3 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-18-2010, 10:33 PM Re: swf clocks + javascript
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
It would be simpler to use the server as a reference for time, since the client time would involve calculations to provide a proper reference time. More than likely there is an ajax call or simply a reference time passed on to the client when the page loads.
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Old 07-19-2010, 04:24 AM Re: swf clocks + javascript
Banned

Posts: 2
Name: mani
Trades: 0
I would like to have the same run
madhuri is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to swf clocks + javascript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.34670 seconds with 12 queries