Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 8th, 2003, 11:44 PM
morro1980 morro1980 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 2 morro1980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 7 sec
Reputation Power: 0
Check if jpeg exists and if not then load alternate image

Hi all,

I am in need of some help in checking if a jpeg exists and if not then loading an alternate image.

At present, if the file does not exist nothing is loaded. I actually got a script from flashguru.co.uk which seems to work locally but when i try and run it on the server it does not seem to execute the backup image if i test on a non existant file.

Does anyone know why this wouldn't work or how i might fix it? For your information the server i am testing on is password protected.

The code is below:

fileExists=new LoadVars();
fileExists._parent=this;
fileExists.onLoad=function(success) {
//success is true if the file exists, false if it doesnt
____if(success) {
____//the file exists
________album.loadMovie("theMovie.jpeg");
____} else {
album.loadMovie("default.jpeg");
}
}
fileExists.load("theMovie.jpeg") //initiate the test


thanks guys
morro

Reply With Quote
  #2  
Old December 9th, 2003, 04:21 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,633 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 15 h 7 m 8 sec
Reputation Power: 538
Facebook MySpace
Hi, I did this already but the post didnt go through:

fileExists=new LoadVars();
fileExists.onLoad=checkIt;

function checkIt(success) {
if(success) {
album.loadMovie("theMovie.jpeg");
} else {
album.loadMovie("default.jpeg");
}
}

fileExists.load("theMovie.jpeg");

Just tried to turn it from using an anonymous function.
not sure if this line does anything:

fileExists._parent=this;


This link has more usefull info.
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Check if jpeg exists and if not then load alternate image


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway