A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Very newbie question...Error opening URL undefined

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    2

    Unhappy Very newbie question...Error opening URL undefined

    Hi Guys,

    I'm really interested in learning Flash. I have followed a tutorial to try and create my first ever Flash project - an image slide-show using XML.

    Here is my XML code:

    <?xml version="1.0" encoding="utf-8"?>
    <slideshow>
    <photo url="amy1.jpg" caption="This is our office in Barnby Dun."></photo>
    <photo url="amy2.jpg" caption="This is the local Barnby Dun church."></photo>
    <photo url="amy3.jpg" caption="The draw-bridge over the River Don."></photo>
    <photo url="amy4.jpg" caption="The church from a distance."></photo>
    <photo url="amy5.jpg" caption="This is not us, but it is what we do."></photo>
    <photo url="amy6.jpg" caption="Barnby Dun road."></photo>
    <photo url="amy7.jpg" caption="The draw-bridge close-up."></photo>
    </slideshow>
    and here is the action script...
    var x:XML = new XML();
    x.ignoreWhite = true;

    var urls:Array = new Array();
    var captions:Array = new Array();
    var whoIsOn:Number;

    x.onLoad = function() {
    var photos:Array = this.firstChild.childNodes;
    for(i-0;i<photos.length;i++) {
    urls.push(photos[i].attributes.url);
    captions.push(photos[i].attributes.caption);
    }
    holder.loadMovie(urls[0]);
    caption.text = captions[0];
    whoIsOn = 0;
    }

    x.load("lost.xml");

    previous.onRelease = function() {
    if(whoIsOn > 0) {
    whoIsOn--;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    }
    }

    next.onRelease = function() {
    if(whoIsOn < urls.length-1) {
    whoIsOn++;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    }
    }
    Now when I try and preview my movie I get this error:




    I have had a search on the forums but haven't found any resolutions to my problem.

    All my files are in the same folder (C/flashmovies) and the files that are in there are:

    amy1.jpg, amy2.jpg, amy3.jpg, amy4.jpg, amy5.jpg, amy6.jpg, amy7.jpg, lost.xml, slideshow.swf and slideshow.fla

    I'm sure this is an easy solution but I am an absolute beginner to this so would appreciate a bit of help.

    Thanks in advance,

    Gaz.

  2. #2
    Junior Member
    Join Date
    Nov 2010
    Posts
    2
    Sorry, I forgot to add that I am using Flash MX. Thanks.

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