Solved

flash ad rotation

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now