|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Check if jpeg exists and if not then load alternate image |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|