Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create banners that load randomly from remote files.

Intractive Flash Tutorials

How to create banners that load randomly from remote files.

by  Gasbag  Posted    (Edited  )
First create a movie, e.g. BannerLoader.swf
Then create the banners. They must have the same dimensions as BannerLoader.swf (400x80 is a good size), but they can be of any duration or filesize and interactive or not.
Name the banner files bannerX.swf, where X is a number. The numbers of the banners start at 0 and must be increment: banner0.swf, banner1.swf, banner2.swf, etc...
Insert two keyframes in BannerLoader.swf.
Label the first one, e.g. "LoopStart" and add the following code:
[color FF0000]Set Variable: "Delay" = 10
Set Variable: "NumBanners" = 75+1
Set Variable: "TmpTimer" = Int(GetTimer/1000)
If ((TmpTimer-(Delay*(Int(TmpTimer/Delay))))=1)
Loop While (CurMovie eq NewMovie)
Set Variable: "NewMovie" = "Banner" & Random (NumBanners) & ".swf"
End Loop
Set Variable: "CurMovie" = NewMovie
Unload Movie (1)
Load Movie (CurMovie, 1)
End If[/color]

And this code to the second:
[color FF0000]Go to and Play ("LoopStart")[/color]

You can modify Delay It represent the number of seconds to wait befor loading the next banner !
[color FF0000]MIND THE QUOTES[/color] almost everything is an expression.
NumBanners represents the number of banners you have + 1 !
The loop in the code eliminates repeating banners. (never the same banner TWICE :)

Gasbag-->

Gasbag's Gas-of-the-Day:
I hope people understand this...
www.xs4all.nl/~enpho/d-coy/MainBox/Releases.htm
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top