Flash Advert Rotator Script Needed.

A Member? Please Login  
type your username and password to login
Date: December 05, 2008, 06:20 PM
268564 members and 165656 Topics
Latest Member: makan
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderator: OmniPotens)  |  Flash Advert Rotator Script Needed.
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Flash Advert Rotator Script Needed.  (Read 170 views)
OmniPotens
Flash Advert Rotator Script Needed.
« on: March 09, 2008, 11:18 PM »

Can anyone help me out with a flash ad rotator script. I'm stock at this point. I urgently need this to be able to upload and show my client a demo of his website. He wishes to have about 10 advert of his products and that of his partner companies displayed in flash and not in animated gif. please can someone help with out with this script?
webemerald (m)
Re: Flash Advert Rotator Script Needed.
« #1 on: March 10, 2008, 02:04 PM »

i believe if u google for a rotator script u will surely get one or else you can try out my dreamweaver extension, it can rotate images and swf files.
let me know if u need it. webemerald@gmail.com
aphoe (m)
Re: Flash Advert Rotator Script Needed.
« #2 on: March 12, 2008, 02:07 PM »

are all the products going to be in just one flash file/animation or a different product will be displayed each time the page is opened or refreshed?

OmniPotens
Re: Flash Advert Rotator Script Needed.
« #3 on: March 16, 2008, 03:47 PM »

@aphoe
Different products will be displayed whenever the pages are refreshed. Now, the adverts are 20 now and yet the flash script is not yet ready. please, if you've got a good link, can you help me out with it.
webguru
Re: Flash Advert Rotator Script Needed.
« #4 on: March 16, 2008, 08:26 PM »

use javascript

replace filename wt flash name

period!
tundewoods (m)
Re: Flash Advert Rotator Script Needed.
« #5 on: March 17, 2008, 01:59 AM »

Here is a quite easy to use random flash script that i guess you should be able to implement.
Step 1
Copy the code into a text file and save as randomflash.php or give any name of your choice.

Step 2
Create a folder and place your flash files inside the folder. eg flash/random

Note that all the flash animations inside this folder will be random selected upon every refresh or reload of the page.

Step 3
Use the following serverside include code to call the randomflash.php

// <?php require_once('randomflash.php'); ?>


<?php
//***************EDIT FROM HERE*********************
//Any directory name should end by the trailing "/"
$your_dirname="random/flash/";//replace the "path to your flash directory /" by the name
// of the directory where you image files are placed, note that the trailing "/" is mandatory

//You can change this if you want but it is not mendatory
$your_alt_tag="ALT TAGS GO HERE ";// You may place image alt tags incase i put images in the directory

//

function displayaaphprandomimage($dirname, $alt){
  $dirhandle = opendir($dirname);
  while (false !== ($file = readdir($dirhandle))) {
    if ($file != "." && $file != ", " && !@is_dir($file) ) {
      $filelist[] = $file;
    }
  }
  closedir($dirhandle);
 
  if(sizeof($filelist) ==0) {
    echo "No file was found in the directory!";
    exit;
  }
 
  srand((double)microtime()*1000000);
  $picnum = @mt_rand(0, sizeof($filelist) - 1);
  $imageName=$dirname.$filelist[$picnum];
  $imageSize = getimagesize($imageName);
 
 if($imageSize[2]==4 || eregi(".swf$", $imageName) ) {
 $result="\n<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" ".$imageSize[3].">";
 $result .="\n<param name=\"movie\" value=\"".$imageName ."\">";
 $result .="\n<param name=\"quality\" value=\"high\">";
 $result .="\n<embed src=\"".$imageName ."\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" ".$imageSize[3]. "></embed></object>";
   } else  $result="\n<img src=\"".$imageName ."\" ". $imageSize[3] ."alt=\"". $alt. "\">";
 
  return $result;
 
  }
?>
<?php  echo displayaaphprandomimage($your_dirname, $your_alt_tag);?>
nduaj (m)
Re: Flash Advert Rotator Script Needed.
« #6 on: March 17, 2008, 10:25 AM »

@tundewoods

nice work!! but i have a question:

are u saying that the "clsid" and all other variables in the flash code can remain de same? so all u need to change is the "src" of the flash file?

If yes, then it means u can actually hook yur code to a Mysql/php script.
tundewoods (m)
Re: Flash Advert Rotator Script Needed.
« #7 on: March 17, 2008, 10:49 AM »

@ Nduaj
All the defined variables names are expected to remain the same including the clsid parameter that defines your flash movie in case the random file selected is a flash animation.

Bear in mind that the script will pick both flash movies and image files that are in a specific defined directory on your web server.

The script is a random file picker and may not necessary need to be plugged into a mysql database.
josyisback (m)
Re: Flash Advert Rotator Script Needed.
« #8 on: March 17, 2008, 11:22 AM »

incase you still have problem go to www.scriptsearch.com and search for ads rotator.that would do you good.
OmniPotens
Re: Flash Advert Rotator Script Needed.
« #9 on: March 17, 2008, 12:21 PM »

@ Posters

Thanks for all your contributions. One Love to you all!

@tundewoods
Presently I'm working on your script. Thanks so much for your contribution. It's nice having you on this thread.
aphoe (m)
Re: Flash Advert Rotator Script Needed.
« #10 on: March 17, 2008, 12:51 PM »

i will try and work on a code
i will test and send it tomorrow
 Software Need Pls  I Need Help On My Adsense Account  What Resolution Do You Design For  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Job Talk Jobs/Vacancies (2) Career Talk Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.