Relative path for dynamic images

What should be syntax to send relative dynamic image to flash template, I tried file:///…/template/logo/xxx.png, and variations of such, but without success, I get error in flash #2036

I usually ask the server for the media path and pass it to the templates so then you can concatenate that.
An example from your previous template:

var path:String = "";

if (element.@id == "media_path") 		
{	
	path = element.data.@value.toString();
}
if (element.@id == "logo1") 		
{	
	tekst.tim1.source = "file:///"+path.replace(new RegExp(/\\\\/g),"\\").replace(new RegExp(/\\/g),"/")+element.data.@value.toString()+".png";
}

For a relative path you don’t need to add “file:///” at the beginning, just:

if (element.@id == "logo1") 		
{	
	tekst.tim1.source = "../media/"+element.data.@value.toString()+".png";
}

Example:

private var homeTeam: String;
var mainPath: String = “file:///C:/CG/blabla/LOGA/”;
//var mainPath: String = “file:///Flags_teams/”;

this.image1.image1.source = mainPath + homeTeam + “.png”;
this.image1.image1.addEventListener(Event.COMPLETE, loader_complete);

file:/// was the problem actually :slight_smile: :slight_smile: :slight_smile: :slight_smile: thanx again :slight_smile:

Privacy Policy   Terms of Service