|
-
Stuck loading stuff in
I have a little problem im stuck on. I'm working on a system that loads images depending on the date of the file. The files are either jpg or swf, so for example:-
08_06_2006.jpg
08_06_2006.swf
There can only be one file(jpg or swf) per date.
So far I can look to see what the date is and load the jpg. My problem is, what if there isnt a jpg and only the swf.
My code so far is:-
months = new Array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
timedate = new Date();
todaydate = timedate.getDate();
day = timedate.getDay();
month = (timedate.getMonth()+1);
month = months[month-1];
year = timedate.getFullYear();
currentdate = +todaydate+"_"+month+"_"+year;
myVar = "images/large/"+currentdate+".jpg";
holder.loadMovie(myVar);
this.onEnterFrame = function() {
gL = holder.getBytesLoaded();
gT = holder.getBytesTotal();
percent.text = Math.round(gL/gT*100);
if (gL == gT && holder._width>1 && holder._height>1) {
delete this.onEnterFrame;
gotoAndStop(3);
}
};
stop();
If the jpg file doesnt exist I get this message in the output window:-
Error opening URL "file:///F|/site/images/large/8_06_2006.jpg"
How do I get flash to say "oh the jpg file isnt there, load the swf instead"?
Thanks
-
Interested User
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|