Random Flash Movies
am 20.09.2009 17:30:51 von gary
A question was posted on another board that the poster wanted random flash
movies to display as the page is reloaded. I posted the script below and
said I thought it could be adapted but that the echo would probably need to
change. Can someone offer some guidance on this? Thanks
Gary
//Chooses a random number
$num = Rand (1,6);
//Based on the random number, gives a quote
switch ($num)
{
case 1:
echo "";
break;
case 2:
echo "";
break;
case 3:
echo "";
break;
case 4:
echo "";
break;
case 5:
echo "";
break;
case 6:
echo "";
}
?>
__________ Information from ESET Smart Security, version of virus signature database 4441 (20090919) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Random Flash Movies
am 20.09.2009 17:33:04 von Ashley Sheridan
--=-y4sIdehHndQX0DsLhKJq
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Sun, 2009-09-20 at 11:30 -0400, Gary wrote:
> A question was posted on another board that the poster wanted random flash
> movies to display as the page is reloaded. I posted the script below and
> said I thought it could be adapted but that the echo would probably need to
> change. Can someone offer some guidance on this? Thanks
>
> Gary
>
>
> //Chooses a random number
> $num = Rand (1,6);
> //Based on the random number, gives a quote
> switch ($num)
> {
> case 1:
> echo "";
> break;
> case 2:
> echo "";
> break;
> case 3:
> echo "";
> break;
> case 4:
> echo "";
> break;
> case 5:
> echo "";
> break;
> case 6:
> echo "";
> }
> ?>
>
>
>
> __________ Information from ESET Smart Security, version of virus signature database 4441 (20090919) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
>
>
Call the movies 1.swf, 2.swf it will make it easier. If not, put them in
an associative array. Then, once the random number has been chosen,
output all the code needed for embedding the Flash player, and in-place
of the movie clip name, put your variable. The switch above is
unnecessary, as it will mean a lot of duplication.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-y4sIdehHndQX0DsLhKJq--
Re: Random Flash Movies
am 20.09.2009 17:41:28 von Eddie Drapkin
On Sun, Sep 20, 2009 at 11:33 AM, Ashley Sheridan
wrote:
> On Sun, 2009-09-20 at 11:30 -0400, Gary wrote:
>
>> A question was posted on another board that the poster wanted random fla=
sh
>> movies to display as the page is reloaded. Â I posted the script bel=
ow and
>> said I thought it could be adapted but that the echo would probably need=
to
>> change. Can someone offer some guidance on this? Â Thanks
>>
>> Gary
>>
>>
>> //Chooses a random number
>> $num =3D Rand (1,6);
>> //Based on the random number, gives a quote
>> switch ($num)
>> {
>> case 1:
>> echo "";
>> break;
>> case 2:
>> echo "";
>> break;
>> case 3:
>> echo "";
>> break;
>> case 4:
>> echo "";
>> break;
>> case 5:
>> echo "";
>> break;
>> case 6:
>> echo "";
>> }
>> ?>
>>
>>
>>
>> __________ Information from ESET Smart Security, version of virus signat=
ure database 4441 (20090919) __________
>>
>> The message was checked by ESET Smart Security.
>>
>> http://www.eset.com
>>
>>
>>
>>
>>
>
> Call the movies 1.swf, 2.swf it will make it easier. If not, put them in
> an associative array. Then, once the random number has been chosen,
> output all the code needed for embedding the Flash player, and in-place
> of the movie clip name, put your variable. The switch above is
> unnecessary, as it will mean a lot of duplication.
>
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
What Ash said, something like:
$flashVids =3D array();
$flashVids[] =3D '/path/to/movie.swf';
$flashVids[] =3D '/different/path/movie.swf';
..... //add any amount more
$randomMoviePath =3D $flashVids[array_rand($flashVids)];
echo "Random flash movie: " . $randomMoviePath;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Random Flash Movies
am 21.09.2009 13:26:37 von gary
As always, thanks for your help.
Gary
""Gary"" wrote in message
news:68.43.09009.CBA46BA4@pb1.pair.com...
>A question was posted on another board that the poster wanted random flash
>movies to display as the page is reloaded. I posted the script below and
>said I thought it could be adapted but that the echo would probably need to
>change. Can someone offer some guidance on this? Thanks
>
> Gary
>
>
> //Chooses a random number
> $num = Rand (1,6);
> //Based on the random number, gives a quote
> switch ($num)
> {
> case 1:
> echo "";
> break;
> case 2:
> echo "";
> break;
> case 3:
> echo "";
> break;
> case 4:
> echo "";
> break;
> case 5:
> echo "";
> break;
> case 6:
> echo "";
> }
> ?>
>
>
> __________ Information from ESET Smart Security, version of virus
> signature database 4441 (20090919) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
>
>
> __________ Information from ESET Smart Security, version of virus
> signature database 4442 (20090921) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
__________ Information from ESET Smart Security, version of virus signature database 4442 (20090921) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php