RE: [Flashcoders] Loading local files with query strings
That's what you'd expect with *local* files, e.g. loading from a filesystem. The filesystem will look for the file with the literal filename "my_swf.swf?id=33". A web server, on the other hand, knows that anything after "?" is not part of the filename, and should be treated as a query string. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Álvaro Saraiva Sent: 14 September 2009 19:17 To: Flash Coders List Subject: [Flashcoders] Loading local files with query strings Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest("my_swf.swf?id=33")); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
how about just escaping the ? symbol 063; On Mon, Sep 14, 2009 at 11:49 AM, Álvaro Saraiva wrote: > Hi Ian, > The reason i'm using query strings it's because the same swf must to > respond in different manners according the parameters passed. > I'm catching the paramenters in loaded swf (its in AS2 :() via _root. > But the same approach in flex works, but with flash IDE dont. > > Is tehre any way to pass the variables to AS2 swf in the call, besides > localConnection for example? > > Thanxs, > Álvaro > > Ian Thomas escreveu: > >> Don't use query strings? >> >> >> Seriously - local file names on files systems don't take query >> strings. You don't have any files called C:\windows\test.exe?id=33, do >> you? >> >> To make a query string work, you need to route the call through an HTTP >> server. >> >> Sounds like you're trying to avoid caching? But I'm not clear why >> you'd want to avoid caching a local, non-dynamic file... >> >> Ian >> >> On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva wrote: >> >> >>> Hi everyone, >>> I have a strange problem loading external assets from local files with >>> Loader() Class in AS3. >>> If i use query string in the file name, the asset don't loads. >>> >>> This code doesnt load the swf file inside a class >>> this.mySWFLoader = new Loader(); >>> this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, >>> displaySwfContainer ); >>> this.mySWFLoader.load(new URLRequest("my_swf.swf?id=33")); >>> >>> if i dont use the '?id=33' it works. >>> >>> Any suggestions? >>> Thanxs in advance, >>> Álvaro >>> >>> >>> >>> >>> ___ >>> 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 >> >> >> > ___ > 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
Re: [Flashcoders] Loading local files with query strings
Hi, But the loaded swf its in AS2, so the swfLoader file cant access the variables in swfLoaded file and vice-versa, right? Álvaro Taka Kojima escreveu: Appending arguments to the end of a swf file acts the same as setting FlashVars. So, I take it you are trying to pass an id to the loaded in sub swf? Another way to go about it would be to wait until it loads, and then access the contents of the subloaded swf and set variables that way. Or you can just use a static var like MyApp.varName = value; and then the subloaded swf can check for MyApp.varName - Taka On Mon, Sep 14, 2009 at 11:48 AM, Ian Thomas wrote: Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest("my_swf.swf?id=33")); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ 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 ___ 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
Re: [Flashcoders] Loading local files with query strings
Hi Ian, The reason i'm using query strings it's because the same swf must to respond in different manners according the parameters passed. I'm catching the paramenters in loaded swf (its in AS2 :() via _root. But the same approach in flex works, but with flash IDE dont. Is tehre any way to pass the variables to AS2 swf in the call, besides localConnection for example? Thanxs, Álvaro Ian Thomas escreveu: Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest("my_swf.swf?id=33")); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
Hi Ian, The reason i'm using query strings it's because the same swf must to respond in different manners according the parameters passed. I'm catching the paramenters in loaded swf (its in AS2 :() via _root. But the same approach in flex works, but with flash IDE dont. Is tehre any way to pass the variables to AS2 swf in the call, besides localConnection for example? Thanxs, Álvaro Ian Thomas escreveu: Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest("my_swf.swf?id=33")); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
Hi, But the loaded swf its in AS2, so the swfLoader file cant access the variables in swfLoaded file and vice-versa, right? Álvaro Taka Kojima escreveu: Appending arguments to the end of a swf file acts the same as setting FlashVars. So, I take it you are trying to pass an id to the loaded in sub swf? Another way to go about it would be to wait until it loads, and then access the contents of the subloaded swf and set variables that way. Or you can just use a static var like MyApp.varName = value; and then the subloaded swf can check for MyApp.varName - Taka On Mon, Sep 14, 2009 at 11:48 AM, Ian Thomas wrote: Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest("my_swf.swf?id=33")); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ 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 ___ 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
Re: [Flashcoders] Loading local files with query strings
___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
Appending arguments to the end of a swf file acts the same as setting FlashVars. So, I take it you are trying to pass an id to the loaded in sub swf? Another way to go about it would be to wait until it loads, and then access the contents of the subloaded swf and set variables that way. Or you can just use a static var like MyApp.varName = value; and then the subloaded swf can check for MyApp.varName - Taka On Mon, Sep 14, 2009 at 11:48 AM, Ian Thomas wrote: > Don't use query strings? > > Seriously - local file names on files systems don't take query > strings. You don't have any files called C:\windows\test.exe?id=33, do > you? > > To make a query string work, you need to route the call through an HTTP > server. > > Sounds like you're trying to avoid caching? But I'm not clear why > you'd want to avoid caching a local, non-dynamic file... > > Ian > > On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva wrote: > > Hi everyone, > > I have a strange problem loading external assets from local files with > > Loader() Class in AS3. > > If i use query string in the file name, the asset don't loads. > > > > This code doesnt load the swf file inside a class > > this.mySWFLoader = new Loader(); > > this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, > > displaySwfContainer ); > > this.mySWFLoader.load(new URLRequest("my_swf.swf?id=33")); > > > > if i dont use the '?id=33' it works. > > > > Any suggestions? > > Thanxs in advance, > > Álvaro > > > > > > > > > > ___ > > 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 > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva wrote: > Hi everyone, > I have a strange problem loading external assets from local files with > Loader() Class in AS3. > If i use query string in the file name, the asset don't loads. > > This code doesnt load the swf file inside a class > this.mySWFLoader = new Loader(); > this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, > displaySwfContainer ); > this.mySWFLoader.load(new URLRequest("my_swf.swf?id=33")); > > if i dont use the '?id=33' it works. > > Any suggestions? > Thanxs in advance, > Álvaro > > > > > ___ > 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