Random flash messages

All about creating websites!
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8082
Joined: 27 Aug 2005, 16:00
16
Contact:

Random flash messages

Post by ayu »

I have a flash message on my site...its like a tip that comes "scrolling" in when you enter....i want to have "random" mesages...like if i have a folder with 10 different flash files...i want them to play randomly as you enter...is there anyone that knows of such a code?

mystikblaze
Infinite Haze
Infinite Haze
Posts: 334
Joined: 11 Jun 2005, 16:00
16
Location: abroad
Contact:

Post by mystikblaze »

..
Last edited by mystikblaze on 21 Jun 2009, 07:40, edited 1 time in total.

User avatar
ayu
Staff
Staff
Posts: 8082
Joined: 27 Aug 2005, 16:00
16
Contact:

Post by ayu »

Didn't really find what i was looking for there :/

User avatar
maboroshi
Dr. Mab
Dr. Mab
Posts: 1614
Joined: 28 Aug 2005, 16:00
16

Here is a script

Post by maboroshi »

Here is a script I found and adopted to flash

set your random flash scroller to use a dynamic text field set its Var name to "message" (without the quotes) include this code in the flash document

Code: Select all

loadVariablesNum("http://www.yoursite.com/filename.php", 0);
create a text file of messages named random.txt this will be the messages displayed

create a php file with this code

Code: Select all


<?

$textfile ="random.txt";

$items = file("$textfile");

$item = rand(0, sizeof($items)-1);

echo "&message=".$items[$item];

?>

Good Luck

:D

Post Reply