Solved

flash ad rotation

Posted on 2002-05-13
3
232 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 50 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
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…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

810 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