Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

flash ad rotation

Posted on 2002-05-13
3
Medium Priority
?
238 Views
Last Modified: 2011-10-03
is it possible to do banner flash ads that rotate or change everytime someone hits refresh or comes to the page again? I do not want to use animated gif image since in this case it would be too large a file size. the flash is about 17K and that is nice and small for the simple presentation.
0
Comment
Question by:MasterMitch
3 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 7007364
I assume these banners are embedded in an HTML page?
You would need a Javascript function that randomly
choses one of your banners when the page loads.

go to..

http://javascriptkit.com/script/script2/randomcontent.shtml

and see if this suits your purpose.
Z
0
 

Accepted Solution

by:
cobblerkid earned 150 total points
ID: 7040788
before you design your banner ad, just make sure your movie is set to 468 X 60 ( or what ever size you want) and develope the simple animation using tweens or ActionScript.

You don't have to use any javascript if you want random ads to appear each time the page is reloaded... you can just use a script in Flash that gives a random number and displays the the corresponding ad...

something like: adNumber = Math.round(Math.random()*10);

where 10 is the number of total ads that you have in the movie.  In the first frame of your swf use the above script, and then use an if statement or function that displays the appropriate movie on the stage(I would use the _x and _y properties to do that)

To keep the file size down just use a template swf that loads the appropriate movie into the template file from your server...

There are quite a few ways to do this, so some feed back might help...

ck
0
 
LVL 6

Expert Comment

by:rootdir
ID: 7043203
Create different small movies and call into ad banner movie or base movie like this

Create array of movie names

Movies= new Array("movie1.swf", "Movie2.swf", "Movie3.swf", "another.swf",.....);

Then use random function to select

Rand_Movie = Math.floor(Math.random()*4);

Load action trigger on banner movie

loadMovieNum (Movies[Rand_Movie], 1);
Movies.splice(Rand_Movie, 1);

That's it You will get what you are looking for

Cheers
RootDir
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to how to record live broadcast.

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question