Random Images |
| I reformatted this page after class to make it easier to read. Also, added the PHP code which at first I had decided to hide until after you completed your assignment for next class (JM, 10/5/06) |
| In PHP (from the Music Department Web site) |
![]() |
| The image names are actually numbers (1.jpg, 2.jpg, etc.) |
| JavaScript (from the Post Theatre Company Web site) |
| Again, the image names are numbers, this time with a lowercase "L" attached to the name (1l.jpg, 2l.jpg, etc.) (To tell you the truth, I don't remember why I attached the "l" -- probably to signify "large" ) |
| ActionScript in Flash (from my Post Web site) |
| In the Actionscript example, the movie names are stored in an array. So, after generating a random number, the movie name is read from the array using the random number as "pointer", i.e. index into the array. (This method is not as efficient as the number-naming system used in the PHP and Javascript examples) |