Random images

hi,
     can anyone help me in this problwm. im trying to create a flash file that is randomly showing different objects/images, i believe i have the correct codes although i have encountered an error.
codes are:
pics = ("image1.png", "image2.png", "image3.png", "image4.png", "image5.png");
loadPicture = function() {
        var ranNum = Math.floor(Math.random()*pics.length);
        mv_loader.loadMovie(pics[ranNum]);
sI = setInterval (loadPicture, 1500);
and i saved them in same folder (FLA and the images)
problem is i get this error message:
Error opening URL 'file:///sheenint/Desktop/John/trials/13/undefined'
what could be the problem?

Be sure to declare your variables properly...
var pics = new Array("image1.png", "image2.png", "image3.png", "image4.png", "image5.png");

Similar Messages

  • Random images display strong yellow/green cast

    system - 24" intel iMac, 3ghz, 2gb, 500bg hd, NVIDIA GeForce 8800 GS with 512MB memory, OS 10.5.4. Just purchased.
    System runs fine, and I love the machine. Problem is random images, jpegs, raw, illustrator files, display an awful yellowish tint, both in the preview and when opened in PS or preview. Just random, sometimes a whole folder of images, sometimes just a few. I, of course tested some of the same images on another mac, and they viewed correctly. If I save a copy to the desktop, the icon looks correct, but when opened it looks like puke. Also happens in front row when displaying certain album covers and video trailer art.
    Anyone else run into this?
    -h

    Hello Double H Media
    Welcome to Apple Discussions!
    Unfortunately the OP and others appear to have the same issue possibly related to the GeForce 8800 GS, see the following thread!
    http://discussions.apple.com/thread.jspa?messageID=7224138&#7224138
    Dennis

  • When opening a folder with "items as icons" view, a millisecond fast random image appears in place

    Hi,
    since I updated to Yosemite (but cannot assure it's related or started exactly that moment) I've been experienced a weird issue.
    When I open a folder to navigate it, and it's set on "show items as icons", I see all the icons, for just less than a second, replaced by random images.
    It's like if while the proper folder/file icon it's loading, that space is temporarily occupied by the impression of another one (or parts of it), coming from my computer. Sometimes is a photo, sometimes another folder icon not related, sometime is the icon of a software.
    The picture then goes away (it stays less than a second) and the icon for the file/folder is then the appropriate one.
    I have a Macbook Pro 15-inc, mid 2010.
    Is it a known issue? If yes, how can I solve, if possible, this?
    Hope can be helpful to others too.
    Many Thanks

    First off, I do not recommend looking at your time machine while it is running.  You can tell if it is running by making sure its menubar icon is shown in Apple menu -> System Preferences -> Time Machine.  If the icon is moving, it is running.   You can manually backup, which I recommend over automatic backup, as automatic backup can get in your way.   Spotlight, if it is indexing (check the menu in the upper right that looks like a magnifying glass), will also slow matters down, and adding things you don't want Spotlight to search to your Apple menu -> System Preferences -> Spotlight -> Privacy pane will help.  Note this affects areas you can search in Time Machine as well.  If searching content of files is of little interest to you, I find Find Any File much quicker for finding by file name.   Backup when you aren't doing anything else, as otherwise, you may find yourself backing up files that haven't had the opportunity to close.
      Time Machine also works best if your destination drive is at least twice as capacious as your source drive.   Otherwise it is spending a lot of time trying to find places for the archived files, and barely is more archival than a simple clone.

  • Hello from a new member and help with random images on refresh

    Hi All,
    I've just joined the forum. In fact I've really only just started to use Dreamweaver. I've covered a lot of ground in the last few weeks and
    have manage to set up a basic site using CSS for layout but now I've hit my first problem.
    On the index page of the site - http://www.hcadesign.co.uk/ there is a large main image which I would like to change each time someone
    visits the site or hits refresh. I've hunted around and found lots of scripts, all using java, that seem to do just this but I'm not having any
    luck getting them to work.
    My pages code is as follows -
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Humphrey Cook Associates - Architects - Interior Designers - Project Managers</title>
    <link href="styles/hca_styles.css" rel="stylesheet" type="text/css" media="screen" />
    </head>
    <body>
    <div id="wrapper">
      <div id="header"><img src="images/header.gif" width="800" height="100" alt="hca_header" /></div>
      <div id="menu">
        <ul>
          <li>About Us</li>
          <li>Residential </li>
          <li>Special Needs Housing</li>
          <li>Hotels</li>
          <li>Conservation</li>
          <li>Interiors</li>
          <li>Offices</li>
          <li>Sustainability</li>
          <li>Commercial</li>
          <li>News</li>
          <li>Contact</li>
        </ul>
      </div>
      <div id="main_image"><img src="images/haydock_atrium_420x300.jpg" width="420" height="300" alt="haydock_atrium" />
      </div>
      <div id="menu_right">
        <h3>Latest News</h3>
        <p>Planning permision finally granted for the proposed 'Villa De France'</p>
        <div id="news_image_01">
          <p><img src="images/news_villa_de_france_90x50.jpg" alt="villa_de_france" width="90" height="50" /></p>
        </div>
        <p>Application submitted for new 30 storey hotel with retail in Tower Hamlets</p>
        <div id="news_image_02"><img src="images/news_alie_St_90x50.jpg" width="90" height="50" alt="alie_street" /></div>
      </div>
      <div id="spacer"></div>
      <div id="bottom_left"><img src="images/riba_logo_127x67.gif" width="127" height="67" alt="riba_logo" /></div>
      <div id="bottom_thumb_01"><img src="images/thumb_beckton_95x67.jpg" width="95" height="67" alt="beckton" /></div>
      <div id="bottom_thumb_02"><img src="images/thumb_edgeworth_link_95x67.jpg" width="95" height="67" alt="edgeworth" /></div>
      <div id="bottom_thumb_03"><img src="images/thumb_tov_bathroom_95x67.jpg" width="95" height="67" alt="haydock" /></div>
      <div id="bottom_thumb_04"><img src="images/thumb_edgeworth_interiors_portrait_95x67.jpg" width="95" height="67" alt="the_old_vicarage" /></div>
    <div id="bottom_right">
      <h1>Architects</h1>
      <h1>Interior Designers</h1>
      <h1>Project Managers</h1>
    </div>
      <div id="footer"></div>
    </div>
    </body>
    </html>
    I've highlighted where the image to be rotated is in red.
    The scripts I've found have generally involved putting something in the <head>, something where the image is to be (but I wasn't sure if it should be
    within the div tag or after img src or what?) and also a seperate *.js file stored in the root directory.
    Anyway I'm not getting anywhere and need some help as I really don't know what I'm doing with javascript.
    Cheers

    Hi and Welcome to the DW Forums. 
    For the sake of clarity, Java is not the same thing as JavaScript. 2 entirely different programming languages.
    Copy and paste the following code into a new, blank HTML page.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Random Banner</title>
    <script type="text/javascript">
    <!--//Random Banner image on Page Reload 
    //store the images in arrays below.
    //First banner is always image [0].
    //If you add more banners images, change the array count (4).
    images = new Array(4);
    images[0] = "<a href='http://www.example.com'>
    <img src='path/first-image.jpg' width=' ' height=' ' alt='some-description' /> </a>";
    images[1] = "<a href='http://www.example.com'>
    <img src='path/second-image.jpg' width=' ' height=' ' alt='some-description' /> </a>";
    images[2] = "<a href='http://www.example.com'>
    <img src='path/third-image.jpg' width=' ' height=' ' alt='some-description'  </a>";
    images[3] = "<a href='http://www.example.com'>
    <img src='path/fourth-image.jpg' width=' ' height=' ' alt='some-description'  </a>";
    index = Math.floor(Math.random() * images.length);
    document.write(images[index]);
    //done
    // -->
    </script>
    </head>
    <body>
    <h1>Random Banner on Page Load.</h1>
    <p>The more images you have in your array, the more random it will seem.</p>
    <p>Change the URLs from example.com to your your own site pages.</p>
    <p>Change path/image to images in your local site folder.</p>
    </body>
    </html>
    Good luck with your project,
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web-design.blogspot.com/

  • Random Image not displaying in Live View.

    My page is at:
    www.andrewjamesartist.co.uk
    There's a random image script on the front page.
    <img src="randomimages/rotate.php" alt="A Sample Image from the work of Andrew James" />
    That's how it is placed in the page.
    It shows in preview in browser and it's OK live but it doesn't show in LiveView.
    I use a testing server set up with virtual hosts.
    Martin

    My page is at:
    www.andrewjamesartist.co.uk
    There's a random image script on the front page.
    <img src="randomimages/rotate.php" alt="A Sample Image from the work of Andrew James" />
    That's how it is placed in the page.
    It shows in preview in browser and it's OK live but it doesn't show in LiveView.
    I use a testing server set up with virtual hosts.
    Martin

  • Pull random images from iPhoto library folders

    I'm trying to come up with a script to pull random images from my iPhoto library and copy them to another folder that I can then use with another program (GeekTool) to display them on my desktop.
    What I'd like to be able to do is pull 30-50 of these images at a time. I can use GeekTool to call the script at a given interval (eg. every half hour) and have a completely different set of images everytime the script is run.
    I'm a complete obliviot when it comes to applescripting, so I'm at the mercy of the experts. I've managed to find a couple of scripts that can do something similar with the screensaver, but I'm unable to figure out the script enough to make it do what I need.
    Any help would be much appreciated. Thanks.
    brad

    You should post your question on the iPhoto forum.
    http://discussions.apple.com/category.jspa?categoryID=143
    Make sure you post your question in the appropriate iPhoto forum based on which version of iPhoto you have (4, 5 or 6).

  • Load Random Image in Flash?

    I've googled it and searched this forum. No luck.
    Does anybody know how to load a random image in flash. Like
    on a welcome screen (i.e. the first thing that shows up in my
    timeline with a stop command on it)
    I tried this:
    http://www.kirupa.com/developer/mx/loadingrandombackground.htm
    but can't do this where you are supposed to paste the code in
    Actions: "Now, look at your timeline. Right click on a blank
    keyframe in the timeline and select Actions. Copy and paste the
    following code: "
    seems like i have to add something first like adding a
    behavior like "goto URL" or "stop" or "goto frame" if you know what
    i mean.
    what do i click on???????????????????? to add this code into
    Actions.
    Thanx.

    let say you have 20 images file in jpg format, all at the
    same directory with your flash file, with file name as below:
    pic1.jpg
    pic2.jpg
    pic20.jpg
    in your flash, select the frame which you wan to load a
    random image, type script below:
    num = Math.ceil(10*Math.random());
    filename = "pic" + num + ".jpg";
    _root.createEmptyMovieClip("pic_mc", 1);
    loadMovie(filename, "pic_mc");
    //good luck

  • Random Image PHP Scipt Issue

    I am using a
    PHP random image
    script on a site in which I have 2 different images on each
    templated page (random images throgh a site). The two images call
    to 2 different folders with the random image script in them (to get
    2 distinct images). Thus, 2 different random images. My issue is
    that it seems that most browsers at some point do not call for a
    new image but use what was there in the last page as it is the same
    name:
    http://ansano.com/asl/images/random/top/random_image.php
    or
    http://ansano.com/asl/images/random/bottom/random_image.php
    Any idea of how to force a browser to call the PHP script? Or
    how to change it so it works site wide?
    Thanks!!

    I've now been sitting looking for this for a while. I don't seem to be able to get it to work.
    Do I need to host to a folder first and then to the FTP server after?
    I don't seen to be able to find the new page (TEST PAGE) in the folder I used to publish the site to before I went online. Tried searching for it in finder but I don't get any results on (TESTPAGEfiles).
    I can see what you are talking bout I only publish to a local folder but I want to publish via the FTP option in iWeb.
    Thank you very much for helping me

  • Running gif animation and a random image output from an html button, HELP!!

    Trying to click (onClick) an animated gif image of an on/off switch to start a second animation which is located on a different location on the web-page (a 7-frame animation of a generator with moving parts) immediately followed by a random image selection function placing an image in a 3rd location on the page (next to the generator image). The random images are supposed to look like the result of the generator animation---the item that “pops out” of the generator.
    We thought the process to achieve this would be an “OnClick” on the on/off switch-animated-gif to start two javascript functions (generato animation function & random image function).
    To further complicate matters, we are doing this website in iWeb. We’re using iWeb SEO Tool to add the javascript to the header and HTML snippet in iWeb to place the HTML code. Not sure we’re actually doing the snippet right though---is it supposed to relate to the images---or is it separate? When the gifs are place on the iweb page, they work in the browser upon page load---the “on-click” & the random image function are NOT working...so we know we’ve done something(s) wrong.
    We’re thinking that we’re probably missing some code that describes where the 3 different image-spots are on the page (image #1 is the on/off switch gif, image#2 is the generator gif, image#3 is the generator output.png)....or just aren’t coding the string of functions correctly---or maybe our strategy for achieving this is just no correct (?).
    Here is the code we have tried that didn’t work. We desperately need a solution quickly and are open to any/other ideas for how to accomplish this. THANKS YOU in advance for your help!!!:
    script language = JAVASCRIPT>
    <!-- Hide script from old browsers
    function gif_animation(){
    if (document.images)
    generator = new Image
    generator_on = new Image
    generator.src = "christmassweatergenerator-offswitch.gif"
    generator_on.src = "christmassweater_generatoron-offswitch.gif"
    // Stop hiding script from older browsers -->
    Random Image Link Script
    By Website Abstraction (http://www.wsabstract.com)
    and Java-scripts.net (http://www.java-scripts.net)
    function random_imglink(){
    var myimages=new Array()
    //specify random images below. You can have as many as you wish
    myimages[1]="christmassweater_GENERATOR_files/cotton_candy_christmassweater.png"
    myimages[2]="christmassweater_GENERATOR_files/eiffel_tower_christmassweater.png"
    myimages[3]="christmassweater_GENERATOR_files/kitty_litter_christmassweater.png"
    myimages[4]="christmassweater_GENERATOR_files/spatula_christmassweater.png"
    <!--//specify corresponding links below
    var imagelinks=new Array()
    imagelinks[1]="#<a class="jive-link-external-small" href="http://www.christmassweaterfun.com/christmassweater_GENERATOR">http://www.christmassweaterfun.com/christmas_sweaterGENERATOR</a>"
    imagelinks[2]="#<a class="jive-link-external-small" href="http://www.christmassweaterfun.com/christmassweater_GENERATOR">http://www.christmassweaterfun.com/christmas_sweaterGENERATOR</a>"
    imagelinks[3]="#<a class="jive-link-external-small" href="http://www.christmassweaterfun.com/christmassweater_GENERATOR">http://www.christmassweaterfun.com/christmas_sweaterGENERATOR</a>"
    imagelinks[4]="#<a class="jive-link-external-small" href="http://www.christmassweaterfun.com/christmassweater_GENERATOR">http://www.christmassweaterfun.com/christmas_sweaterGENERATOR</a>"
    -->
    var ry=Math.floor(Math.random()*myimages.length)
    if (ry==0)
    ry=1
    document.write('<a href=''"'+imagelinks[ry]+'"''>')
    random_imglink()
    //-->
    </script>
    <!--the HTML:
    <a href="#" onclick="function gif_animation(); function random_imglink();">

    What's the URL of your site so we can examine it first hand? When you added the code to your post the servers messed it up and tried to render it on the page. We can get the code if we can get to your site.
    OT

  • Looking for a random image extension

    Does anybody know of a good FREE extension that will put a
    random image inside a cell of a table?
    I'm actually looking to do two different things. The first: I
    want a random image from about 10 images to change every time the
    user reloads the page. The second: I want images from about 10
    images to fade up, stay on the page for a few seconds, then fade
    down and have another one of the 10 fade up, so on and so forth.
    If anyone knows of a free extension that will do this, I
    would love to know about it, thanks!

    This one works fine for me,
    * Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (
    http://www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit
    http://www.dynamicdrive.com/
    for this script and 100s more.
    hth

  • Choose random image script

    I'm creating a small movie with a set of random images that all appear in the same spot (no horizontal or vertical movement). I want each image to appear onscreen for two seconds, then be replaced by another randomly-chosen image. There are 17 images in the set. Here is the script I'm using:
    on enterFrame
      channel=random(17)
      _movie.delay(2*60)
    on exitFrame
      go to the Frame
    end
    This script works well. However, because the population is small - only 17 - what happens when I run the script is that a little too often it randomly chooses the same image once, twice, sometimes up to five times in a row, which gives the effect that the movie is either stuck or not working properly. I would like to find out how to modify the script so that on exitFrame it chooses randomly any of the other 16 images but not the current image. At first I thought if the script read random(16) or random(17-1) that might work, but it doesn't.
    Any thoughts would be welcome.
    Dallas

    Hi Sean,
    This randomizing project of mine is becoming more complex than I first realized and I now have another question that I hope you might be able to help me with.
    The project breaks down into class, category, group and member. There are 9 classes (and perhaps a possibility in the future that further classes could be added). The structure and naming convention within each class is identical down to the member level. For example, Cat. 1 of Class 2 and Cat 1 of Class 7 both have the same names. Group 3 of Cat. 1 of Class 2 and Group 3 of Cat 1 of Class 6 both have the same names. However, the members of these groups do not have the same names.
    In each class there are 4 categories, each with a different name. Each category contains a number of groups (each group has a different name). Each group contains a number of members. Each member in categories 1 and 2 is a bitmap image. The total number of bitmap members in the project is 21.
    To give a fictionalized example (this project is not about clothing, but I'm using it as an example):
    Class 1 = shirts
    Class 2 = hats
    Class 3 = pants
    Class 4 = socks
    Class 5 = shoes
    etc.
    Category 1 = British
    Category 2 = Japanese
    Category 3 = Turkish
    Category 4 = Brazilian
    Group 1 = Cotton
    Group 2 = Synthetic
    Group 3 = Speed
    Group 4 = Sound
    and so forth.
    In Class 1 (shirts) there are British, Japanese, Turkish and Brazilian shirts and these could be made of either cotton or synthetic. In addition, there are a variety of speeds and sounds from which to choose when displaying the shirts.
    In my project:
    Cat. 1 has 7 groups and each group varies in the number of members with either 7, 14 or 21 (but no other alternative to these numbers).
    Cat. 2 has 13 groups and each group has 7 members.
    Cat. 3 does not randomize images but lets me choose any one of 12 different speeds for randomization in half-second increments.
    Cat. 4 does not randomize images but lets me choose any one of 6 different sounds. Whenever the randomized image changes, this triggers the sound. The sound is not randomized but is consistent once the choice for what KIND of sound has been made. In short: tick, tick,tick, or tock, tock, tock but not tick, tock. It is possible that in the future more sounds could be added.
    Navigation should allow me to start with any of the four categories. For randomization to work, I must choose within either Cat. 1 or Cat. 2 (but not both) and I must make a choice of some sort within Cat. 3 (speed of randomization) while Cat. 4 is entirely optional (sound on or off, but not required to be on and, if it's to be on then choice for which kind of sound).
    There are also an additional two buttons for sound on or off than run the length of the score within any class, meaning that while randomization is occuring anywhere within a class, I can choose to turn the sound on if it's currently off or off if it's currently on. Turning it on while randomization is taking place will also probably require a choice of which kind of sound (meaning a floating window I suppose) so as not to exit the frame where randomization is taking place.
    Now for my question: should I create one massive behaviour script for all classes that includes a series of nested if/else statements for each category, group and member, or should I create 4 large behavior scripts, one for each category with if/else instructions for its groups and members, or should I script at the group level, which will result in 180 separate behaviour scripts for image randomization plus additional scripts for speed and sound?
    Further, I understand how to apply at the group level the script you gave me earlier (and it works beautifully), but if you think it would be more efficient now to work at the category or class level, I'm not sure how to script the if/else statements. I'm assuming that in whichever of these solutions turns out to be best, it is applied to a single sprite which will serve to display the randomly-chosen image. Bear in mind that the script you gave me randomizes the image change every two seconds. Now I'm looking to have a choice of it changing within a range of once every half-second to once every 5 seconds (e.g. 0.5 sceonds, 1 second, 1.5 seconds, 2 seconds, etc.).
    An ancillary question: could this be done a different way? A friend suggested using subroutines but wasn't able to tell me how to do this because he doesn't know anything about Lingo. I was wondering whether the if/then syntax structure is Lingo's way of doing subroutines.
    Your thoughts would be most welcome. If you think you can't help me with this, do you have any suggestions as to where I might turn for help (apart from the nuthouse at this point)?
    Cheers,
    Dallas

  • Randomizing image/text on refresh

    Hello. I'm new...quite new to DW and web work, but have a small, general understanding of it. I'm an animator and am in the midst of creating my own portfolio site. I don't understand code, at least uber-extreme code. I'm attempting to have specific quotes on my homepage from clients and would like to have them change, or have a new text/quote appear on refresh or upon a new visit to the site (just so it's not the same one everytime).
      Would I need to just render out a .swf file in AE or is there a means of doing this within DW w/o using crazy code? Thanks in advance, Andy

    HTML has no way to do something like this.  You would indeed have to use Flash, or JavaScript, or some server-scripting to accomplish that task.
    It's quote easy to do with something like PHP, for example, by declaring a random variable in the page, e.g.,
    <?php
    $imageVar = rand(1,5) /* this will generate a random number between 1 and 5 */
    ?>
    and then using that random variable in the image's source attribute -
    <img src="images/random/image<?php echo $imageVar; ?>.jpg" />
    If you are getting the idea that you will have to come to grips with code sooner rather than later, then you are on the right track.  DW is very punishing to those who won't take the time to learn the underlying technologies....
    If you Google "random image" and "Dreamweaver" you may also be able to find extensions that do the same thing for you (in JavaScript).  I would recommend that you visit http://www.projectseven.com and search there - I do know that they have such a thing, and can wholeheartedly endorse their products as being the best of show....

  • Browser triggered random image

    Could someone please help me create a random image action? I thought I could use the randomimage in the "action" window, but this requires a "mouse enter" or "mouse click" etc. How do I get the images to simply change each time the page is refreshed?
    GoLive help tells me to create a browser triggered action, but this is not an option in the action tab. ???

    In article <[email protected]>,
    [email protected] wrote:
    > How do I get the images to simply change each time the page is refreshed?
    In this case you need to use the Random Image action as a HEAD action,
    triggered by page load.
    Place your base image on the page and name it. Then drop a head action
    item from the Objects palette (watch the tooltips) onto the page; the
    head section of the page will now spring open. With the icon selected
    assign the Random Image action to it, set it to run onLoad and select
    your base image.
    That's it.
    Cheers Martin

  • Random Images in Dreamwaever CS5?

    Hi,
    I'd like to set up  my site so that every time the homepage reloads, a different image dispays each time. How is this done in Dreamweaver?
    Thanks!

    It would require either custom javascript or some server-scripting.  Google "random image on load" - you will surely find a boat load of scripts.

  • Random images cramming my library

    A ton of random images, apparently mostly from webpages I've browsed, show up in my iPhoto library. This is driving me crazy and making me angry. I have everything from pictures of Queen Elizabeth (figure that one out) to dozens of puppy pictures.
    I don't want these, I never knowingly imported them, and I want to end their invasion into my library. Anyone got any ideas why they're showing up and how to stop them?

    This can happen when a foldr like your Library folder is inadvertently dropped on your iPhoto icon or Library icon and the image contents are then imported.
    Fastest solution: Restore from your back up.
    Otherwise: delete them.
    Regards
    TD

  • PHP Random Images (Mr. Powers or other PHP Experts)

    Hello everyone,
    This is the script from David Power's book using arrays and the rand function (Disclosure).
    Basically it changes the images randomly on browser load or refresh.
    However, I am trying to add an additional, not sure what to call it, a string or another caption for each images.
    Instead of this being a caption, it will be a link, so a link will appear under each caption that goes to another page
    when it is clicked on for additional info about the image.
    I tried adding another caption and adding a like to it but getting syntax error.
    Thanks everyone!
    Here is the code:
    <?php
    $images = array(
    array('file' => 'image1',
    'caption' => 'Caption 1'),
    array('file' => 'image2',
    'caption' => 'Caption 2'),
    $i = rand(0, count($images)-1);
    $selectedImage = "graphics/{$images[$i]['file']}.png";
    $caption = $images[$i]['caption'];
    ?>
    And here is where the images are written to the page:
    <div id="stage">
    <img src="<?php echo $selectedImage; ?>" alt="Random image" />
    <p id="caption"><?php echo $caption; ?></p>
    </div>
    Thanks everyone!
    WE

    Thanks for the helpful link!
    I found the solution to the problem it was very simple and I feel a little stupid asking the question in the first place but, that's how learning works.
    We sometimes stumble upon knowledge.
    The problem is I was adding the second string outside of the array.
    Here is the right way:
    array('file' => 'image1',
    'caption' => 'Hello!',
    'link1' => '<a href="http://www.msnbc.com">Read more</a>',<--Instead of putting the link here
    link2' => '<a href="http://www.npr.org">Idea Center</a>'
    <-- I was putting the link here out side the array and not properly ending the string.
    $i = rand(0, count($images)-1);
    $selectedImage = "graphics/{$images[$i]['file']}.png";
    $caption = $images[$i]['caption'];
    $link1 = $images[$i]['link1'];
    $link2 = $images[$i]['link2'];
    ?>
    Output here:
    <div id="stage">
    <img src="<?php echo $selectedImage; ?>" alt="Random image" />
    <p><?php echo $caption; ?></p>
    <?php echo $link1; ?>
    <?php echo $link2; ?>
    </div>
    WE

Maybe you are looking for

  • My iPod Touch will no longer stay connected to the internet

    Right before updating to iOS 6, I was using FaceTime and other various apps that require an internet connection, and they all worked just fine. After updating to iOS 6, I noticed that things took a much longer time to load, such as Facebook. I then n

  • Not recognizing external hard drive after upgrading to mountain lion

    I recently upgraded to mountain lion.  While my external hard drive originally showed on the desktop it does not anymore,  The hard drive is partitioned between my wife (laptop) and my desktop.  My wife's part does show on the desktop but mine does n

  • Javascript window.open needs to always open in a new window

    I am tring to create a menu system. When the user selects an item, then clicks Open Application, I want them to be able to open the application in a new browser window with specific window prefs. I have added this javascript to my page html header fu

  • PDF Error in Adobe In Design

    Hello Please help me, when I export a file on In Design to Print Ready PDF. The PDF Saves and opens fine on my Computer. However when i email it to anyone the PDF Comes up with errors. What could be the problem? Regards Asief eBucket

  • HR:Report to Check changes in Personal/ PeriodsofService/Assignment Details

    Hi, Is there a way to gather in one Report for Data Entry Checking purposes all changes in Personal/ Person Type/Periods of Service/Assignment Details based on Last Update Date/ User from fnd user tables? We use Discoverer for Reporting of Oracle HR