FORUMS: list search recent posts

How To Make Page Reload With Different Text

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
zack hill
How To Make Page Reload With Different Text
on Mar 17, 2008 at 7:10:08 pm

Hello Flash forum,
This is my first post here, as mostly have posted on FCP forum.

On this homepage SWF that I built [ ]
The client wants the header [ The Perfect Fit... ] to change each time the page refreshes.
So, first view of the page would be "The perfect fit...", then on reload, it would be, "New storage solutions..."

I am not very good with actionscripts, and am having trouble trying to find an easy solution for this. I have investigated Arrays, and even was given some code from Dynamic Drive forum which was this:

The basic principle is you load all of the text/items into and array. Then use the Math.random() function to randomly choose an index for the item.

If you want to hardcode the values, you could do something like this:

var slogans = array("Text 1", "Text 2", "Text 3");
var randomNumber = Math.ceil(Math.random()*3);
text_field.text = slogans[randomNumber]

I don't even know where to put this code, would it go at the end where the actions tell the movie to stop?
Is there a reload function that will direct the movie to play the alternate text?
There has to be an easy way to do this, and good karma to whomever can enlighten me!

HELP! I am clueless...

Thanks in advance!
Flash CS3

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved