URLloader with different file formats


hi!

 

i´m loading external logo swf following code:

 

var request:urlrequest = new urlrequest("logo.swf");
var logoloader:loader = new loader();
logoloader.load(request);
addchild(logoloader);
logoloader.x = 5;
logoloader.y = 5;

 

everything works fine long have logo.swf in right place. there easy way improve code wouldn´t matter if there logo.swf, logo.png or logo.jpg long 1 of files exists in right place?

 

i give clients change use other formats swf if like, because of them doesn´t have flash or other software swf exporting capability.... of them have photoshop or other image software....

 

thanks!

if understood correctly, these kind of things accomplished via passing configuration values flash @ runtime. flash has no way to read directories. if don't want make clients configure application pointing right image load, 1 of ways (which not improvement rather hack) attempt loading possible variations in predefine logical sequence , load images/swfs don't return ioerror.

 

but, again, ugly hack , cannot possibly cover unfoseeable scenarios. instance, if name not logo logo1?

 

just word of caution. basically, in case, there rules of engagement. clients should aware breaking these rules not have working application. if promise clients kind of automation - may subject unpleasant surprises down road.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support