Error opening URL undefined

  • R123
  • Born
  • Born
  • R123
  • Posts: 3

Post 3+ Months Ago

hello,

I am having a problem with my flash actionscript. I am new to flash and am learning slowly from tutorials.
I have created a full flash website but still need to add a photogallery. I have downloaded a flash photogallery that I would like to integrate into my existing website; unfortunately it does not work. I copy all the frames and code exactly and paste them. I have to paste them into a movie clip , which is in already in another movieclip (its confusing);
Scene1 --> movieclip1 --> movieclip2;
photogallery is pasted into moviclip2.

I keep on getting an error and so the photogallery does not work fully.


Error opening URL "file:///C|/Documents%20and%20Settings/Admin/Desktop/folder1/undefinedimages/1.jpg"



there are two sets of actionscript and I believe the problem is with the second one.

1.
stop();
//specify the url where folder is located below (if applicable)
toadd="";
_root.t = 0;
_root.l = 0;
theside = 1;
galxml = new XML();
galxml.load(toadd+"easy-xml-gallery.xml");
galxml.ignoreWhite = true;
galxml.onLoad = function(success) {
if (success) {
maxnum = galxml.firstChild.childNodes.length;
for (n=0; n<maxnum; n++) {
specs = galxml.firstChild.childNodes[n];
//TEXT FOR SIDE NAV
duplicateMovieClip(side.thumbs.thumbsb, "thumbs"+n, n);
thumbclip = eval("side.thumbs.thumbs"+n);
if (theside == 1) {
thumbclip._x = 0;
theside = 2;
} else {
thumbclip._x = 100;
theside = 1;
}
thumbclip._y = Math.floor(n/2)*75;
thumbclip.thetitle = specs.attributes.name;
thumbclip.thecaption = specs.attributes.caption;
thumbclip.thenum = n+1;
thumbclip._alpha = 100;
loadMovie(toadd+"images/"+(n+1)+"b.jpg", thumbclip.thumbload.thumbload2);
play();
side.thumbs.thumbsb._visible = false;
}
}
};
mainperc.onEnterFrame = function() {
if (mainperc.perc<98 ) {
mainperc._alpha += 5;
}
mainperc.perc = Math.round(_root.l/_root.t*100);
mainperc.perctext = mainperc.perc+"%";
mainperc.ltext = "OF THUMBNAILS LOADED ("+Math.round(_root.t/1024)+"kb)";
if (mainperc.perc>98 ) {
//mainperc._alpha -= 5;
}
if (mainperc._alpha<-50) {
delete mainperc.onEnterFrame;
}
};


2.
stop();

pic.info.thenum = side.thumbs.thumbs0.thenum;
pic.info.thecaption = side.thumbs.thumbs0.thecaption;
pic.info.thetitle = side.thumbs.thumbs0.thetitle;
loadMovie(_root.toadd+"images/1.jpg", pic.pic2.pic3);
onEnterFrame = function () {
side.gotoa = 110;
if (side._alpha>99) {
side._alpha = 100;
delete onEnterFrame;
}
side.lefta = side.gotoa-side._alpha;
side._alpha += side.lefta/5;
pic._alpha=side._alpha;
};



I have a feeling that the problem is related to _root. When I copy the exact code and paste it into a new file (into Scene1) everything works correctly; therefore my directory structure is fine. I have a feeling the error has to to with levels or something?

All the thumnails appear but not the actual pictures.

It uses XML and I know the XML is working correctly because all the data in the XML is loaded.


any help would be appreciated.




Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

you are not supposed to place all your code in a movieclip.
1st part remains in a key frame from main timeline (_root), the other one you can place in a keyframe from a movieclip.
  • R123
  • Born
  • Born
  • R123
  • Posts: 3

Post 3+ Months Ago

thanks for the response, I have tried this and now none of the xml and thumbnails are loading; but the main image is. Would it be easier if I emailed the file to someone? HELP I'm stuck.
I think that what IceCold said should normally work but I have my website using instance names for sets of frames; when i button is clicked it goes to that frame.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

in the second part, you still use the variables which are created in _root, that's why they only work in the root. So either place _root. or relative path using this._parent in front of the variables ... or redesign the entire script, and create the variables/movieclips within the movieclip that you want to have as holder ... which is easy and more effective.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 14 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.