You are right about the base path being the html, so you should get to your
css by passing in the complete relative path, so:
'../path_to_css/cssfile.css' when the html is in 'somefolder' en the css is
in 'path_to_css' folder

-----Oorspronkelijk bericht-----
Van: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] Namens sebastian
Verzonden: zaterdag 17 april 2010 23:53
Aan: Flash Coders List
Onderwerp: Re: [Flashcoders] reading a css from "www"?

sweet thanks Benny, this replacement method worked! yaay!

btw, as far as i can tell, the flash file tries to load the files 
relative to the path of the current URL, and not the path relative to 
the SWF itself...

so if if the HTML file is in:

http://mysite.com/somefoloder/index.html

and you load: ('file.css');

then it will look in:

http://mysite.com/somefoloder/file.css

even if the swf is being loaded from:

http://mysite.com/flash/flashfile.swf

If I am wrong, and the path is relative to the swf, then I am completely 
confused as to why i have to use full URL paths and I cant just type 
"file.css" and get it to load when the swf and the css file are actually 
stored on the server from the same location...

Best,

Seb.


Benny wrote:
> You could use the url from which your swf is loaded, replace the filename
of
> the swf by that of the css.
> 
> In your main movie (from top of my haead, i.e. not tested ;-) use
something
> like:
> 
> var cssFullURL:String = this.loaderInfo.url.replace(/thecallingfile\.swf
> /,"cssFile.css");
> trace(cssFullURL);
> 
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> 



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to