swf banner rotate every X sec without refresh

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
giliat
Forum Commoner
Posts: 28
Joined: Sun May 20, 2007 2:00 pm

swf banner rotate every X sec without refresh

Post by giliat »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hello 
I try to get all banners - swf from a dir and put them into array now i need to push the array into i think javascript that will dislpay difrent swf every X sec 

this is the PHP script to get all swf into array

Code: Select all

<? 


$imglist=''; 


$img_folder = "banner/gil/"; 

mt_srand((double)microtime()*1000); 


$imgs = dir($img_folder); 

//read all files from the directory, checks if are images and ads them to a list (see below how to display flash banners) 
while ($file = $imgs->read()) { 
if (eregi("swf", $file)) 
$imglist .= "$file "; 

} closedir($imgs->handle); 

//put all images into an arry 
$imglist = explode(" ", $imglist); 
$no = sizeof($imglist); 

?>

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

And... what's the problem?
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

You ignored the main part of my answer:
Pass your $imglist to the global js array and the go to the 'Client Side' forum with questions Smile
Seriously, after you do it you can use setTimeout (http://developer.mozilla.org/en/docs/DO ... setTimeout) where you will change you banner.
You just copied your message and moved it to another forum.

Have you tried to prepare JS code?
Post Reply