INM home

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [dir 8] Afficher une image par défaut si chemin non trouvé



william.belleudy wrote:
> Bonjour à tous
> j'ai une liste de nom
> en sélectionnant un nom j'affiche une photo.
> member("PLANCHE_00").fileName = the moviePath
> &"@PHOTO"&member("NOM_REPERE").text & "" & member("NOM").text
>
> Je souhaiterai si une photo n'existe pas dans le dossier PHOTO
> afficher une photo par défaut, mais la je sèche
> Une piste ?
> merci beaucoup
> William
Par sécurité, tu peux tester aussi le type une fois chargé : si le 
fichier
n'est pas un bitmap ou si le type de bitmap est inconnu de Director, il 
va
foiré
Attention : si tu charges un fichier avec filename, celui-ci perd son 
nom.
Il faut donc stocker le membre dans une variable, car après le 
filename, il
sera impossible de faire member("photo") par ex.
strFile = the moviePath &"@PHOTO"&member("NOM_REPERE").text & ""
&member("NOM").text
xFX = xtra("fileXtra4").new()
mb=member("PLANCHE_00")
ok=FALSE
if xFX.fx_fileExists(strFile) then
   mb.fileName = strFile
   if mb.type=#bitmap then ok=TRUE
end if
if not(ok) then
   mb.image = member("imageParDefaut").image.duplicate()
end if

-- 
JM Gervasoni
Freelance Multimédia - internet
Création de logiciels multimédia et sites web
http://www.wapitistudio.com



pistes-l List Home | Main Index | Thread Index
Search archives

 

 


© 2002 Integration New Media. All rights reserved.
Legal | Sitemap

 

Services Solutions Products Support Gallery Store Download Feedback Contact About Us