dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Loading Images

  1. #1
    Senior Member Bobby Hill's Avatar
    Join Date
    Feb 2004
    Posts
    243

    Loading Images

    I have the following code in my swf but when I publish it in html it doesn't display the images. So how can I get the swf file to display the images that are in this particular folder when it is published to html?

    Code:
    var imgList:Array = new Array();
    imgList[0] = "/images/coral.jpg";
    imgList[1] = "/images/horizon.jpg";
    imgList[2] = "/images/resort.jpg";
    imgList[3] = "/images/sunset.jpg";
    function chooseTheString() {
    	randomPic = random(imgList.length-1);
    	_root.holder.loadMovie(_root.imgList[randomPic]);
    }
    chooseTheString();
    stop();
    "My boss sits and watches TV in a hot dog suit and I think he might be a moron."

  2. #2
    FK's Official Mac Hater jasonsplace's Avatar
    Join Date
    Mar 2002
    Location
    Provo, Utah
    Posts
    2,245
    I'm not positive on this as I can't see your folder structure but the problem may be in that you have the slash at the beginning of your path. If the images directory is relative to the position of the swf then you will want to remove it. Using:
    Code:
    /images/coral.jpg
    goes to your root directory and then looks for an images folder there where using:
    Code:
    images/coral.jpg
    looks for an images folder in the same directory as your swf.
    Jason L. Wright
    I'm not that hard to imitate. Just make some random negative claim at Apple or anything else for that matter and then have nothing to back it up.

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