A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: not just random (on load) image, random (on load) imageS

  1. #1
    damn, im smooth drkknght's Avatar
    Join Date
    Feb 2001
    Posts
    159

    not just random (on load) image, random (on load) imageS

    i know that there's a code so that each time a page is viewed or refreshed, you can randomly display one of several images that you have placed somewhere, in a folder on your server.

    what im looking for is a little more complicated.

    i want to add a header to my forum, similar to the one here at threadsdev, with an image aligned left, an image aligned right, and also a background image for the cell, behind the two.

    i'd have various sets of that combo. left pic A, right pic A, and bg pic A would be one set. then, when refreshed, maybe left pic D, right pic D, and bg pic D would appear.

    izzat possible?
    i'm not new to action scripting. i'm just bad at it.

  2. #2
    Huygens to Titan PCRIDE's Avatar
    Join Date
    May 2002
    Location
    PLUTO
    Posts
    1,335
    you have to use PHP at least, here is the code to build an array

    PHP Code:
    [SIZE=3]

    <?
     $pictures = array("pic1.jpeg" , "pic2.jpeg" , "pic3.jpeg" , "pic4.jpeg" , "pic5.jpeg" , "pic6.jpeg" , "pic7.jpeg" );
      shuffle($pictures);
    ?>
    <HTML>
    <HEAD>
    <title>Your page name</TITLE>
    </head>
    <BODY>
     <CENTER>
    <H1> your page here</H1>
    <table width = 100%>
    <tr>

    <?
     for ( $i = 0; $i < 3;  $i++ )
    {
       echo"<td align = center><img src=\"";
       echo $pictures[$i];
       echo "\" width = 100 height = 100></td>";
    }
    ?>

    </tr>
    </table>
    </body>
    </HTML>
    [/SIZE]
    Last edited by PCRIDE; 04-07-2004 at 02:55 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center