Re: [Flashcoders] swf paths...
Hi Maurice, Check out the base attribute for the object / embed tag (you can also define it with SwfObject and similar scripts for embedding swfs): base - . or *[base directory]* or *[URL]*. Specifies the base directory or URL used to resolve all relative path statements in the Flash Player movie. This attribute is helpful when your Flash Player movies are kept in a different directory from your other files. http://kb2.adobe.com/cps/127/tn_12701.html Set it to swf and it should work without needing to hard code paths. I think you can also do this: loadSomethig(../xml/some.xml) if, for instance, you have an xml folder at the same level as swf. Cheers Juan Pablo Califano 2009/6/3, maurice sallave mo.be...@gmail.com: Hello! First time on here, so thanks for any advice. I'm pulling in a preloader.swf file into an html file that sits at root swf/preloader.swf. All my swf's are located in a swf directory that gets preloaded into this preloader.swf - simple enough. I'd like to try to keep my server as clean as possible without having to hard-code the path into the preloader.swf file and don't want to use flashvars as a way of referencing my targeted path. Is there another way of doing this? Of course if I put the html file inside the swf directory, everything works, but it defeats the purpose of keeping my server organized. I hope this makes sense and again thanks in advance. ___ 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] swf paths...
Hi Maurice, How about sending it in as a URL variable when you load preloader.swf into the html page? In the HTML: object . param name=movie value=swf/preloader.swf?path=swf/ / ... embed src=swf/preloader.swf?path=swf/ .../ /object Then in preloader.swf: var ojtParams:Object = this.loaderInfo.parameters; var swfPath:String = ojtParams.path; hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of maurice sallave Sent: Wednesday, June 03, 2009 1:30 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] swf paths... Hello! First time on here, so thanks for any advice. I'm pulling in a preloader.swf file into an html file that sits at root swf/preloader.swf. All my swf's are located in a swf directory that gets preloaded into this preloader.swf - simple enough. I'd like to try to keep my server as clean as possible without having to hard-code the path into the preloader.swf file and don't want to use flashvars as a way of referencing my targeted path. Is there another way of doing this? Of course if I put the html file inside the swf directory, everything works, but it defeats the purpose of keeping my server organized. I hope this makes sense and again thanks in advance. ___ 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] swf paths...
Thanks for the replies. I'll be looking into both. kind of been playing around with this as well: str = _url; slash = str.lastIndexOf(/); str = str.substring(slash+1, str.length); dot = str.lastIndexOf(.); filename = str.substring(0, dot); directoryLocation = _url.split(filename + .swf).join(); and setting it to frame 1. On Wed, Jun 3, 2009 at 2:15 PM, Robert Leisle b...@headsprout.com wrote: Hi Maurice, How about sending it in as a URL variable when you load preloader.swf into the html page? In the HTML: object . param name=movie value=swf/preloader.swf?path=swf/ / ... embed src=swf/preloader.swf?path=swf/ .../ /object Then in preloader.swf: var ojtParams:Object = this.loaderInfo.parameters; var swfPath:String = ojtParams.path; hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of maurice sallave Sent: Wednesday, June 03, 2009 1:30 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] swf paths... Hello! First time on here, so thanks for any advice. I'm pulling in a preloader.swf file into an html file that sits at root swf/preloader.swf. All my swf's are located in a swf directory that gets preloaded into this preloader.swf - simple enough. I'd like to try to keep my server as clean as possible without having to hard-code the path into the preloader.swf file and don't want to use flashvars as a way of referencing my targeted path. Is there another way of doing this? Of course if I put the html file inside the swf directory, everything works, but it defeats the purpose of keeping my server organized. I hope this makes sense and again thanks in advance. ___ 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] swf paths...
Here's another version: var str:String = http://www.yourDomain.com/dir1/dir2/dir3/preloader.swf;; var intFirst:int = str.indexOf(.com/) +5; var intLast:int = str.lastIndexOf(/)+1; var intPathLen:int = intLast - intFirst; // var serverName:String = str.substr( 0, intFirst ); var directoryPath:String = str.substr( intFirst, intPathLen ); var fileName:String = str.substr( intLast ); // trace( serverName: +serverName, \ndirectoryPath: +directoryPath, \nfileName: +fileName ); Cheers, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of maurice sallave Sent: Wednesday, June 03, 2009 3:11 PM To: Flash Coders List Subject: Re: [Flashcoders] swf paths... Thanks for the replies. I'll be looking into both. kind of been playing around with this as well: str = _url; slash = str.lastIndexOf(/); str = str.substring(slash+1, str.length); dot = str.lastIndexOf(.); filename = str.substring(0, dot); directoryLocation = _url.split(filename + .swf).join(); and setting it to frame 1. On Wed, Jun 3, 2009 at 2:15 PM, Robert Leisle b...@headsprout.com wrote: Hi Maurice, How about sending it in as a URL variable when you load preloader.swf into the html page? In the HTML: object . param name=movie value=swf/preloader.swf?path=swf/ / ... embed src=swf/preloader.swf?path=swf/ .../ /object Then in preloader.swf: var ojtParams:Object = this.loaderInfo.parameters; var swfPath:String = ojtParams.path; hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of maurice sallave Sent: Wednesday, June 03, 2009 1:30 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] swf paths... Hello! First time on here, so thanks for any advice. I'm pulling in a preloader.swf file into an html file that sits at root swf/preloader.swf. All my swf's are located in a swf directory that gets preloaded into this preloader.swf - simple enough. I'd like to try to keep my server as clean as possible without having to hard-code the path into the preloader.swf file and don't want to use flashvars as a way of referencing my targeted path. Is there another way of doing this? Of course if I put the html file inside the swf directory, everything works, but it defeats the purpose of keeping my server organized. I hope this makes sense and again thanks in advance. ___ 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] swf paths...
ah sumly cool. Thanks for showing off. I love it. On Wed, Jun 3, 2009 at 3:52 PM, Robert Leisle b...@headsprout.com wrote: Here's another version: var str:String = http://www.yourDomain.com/dir1/dir2/dir3/preloader.swf;; var intFirst:int = str.indexOf(.com/) +5; var intLast:int = str.lastIndexOf(/)+1; var intPathLen:int = intLast - intFirst; // var serverName:String = str.substr( 0, intFirst ); var directoryPath:String = str.substr( intFirst, intPathLen ); var fileName:String = str.substr( intLast ); // trace( serverName: +serverName, \ndirectoryPath: +directoryPath, \nfileName: +fileName ); Cheers, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of maurice sallave Sent: Wednesday, June 03, 2009 3:11 PM To: Flash Coders List Subject: Re: [Flashcoders] swf paths... Thanks for the replies. I'll be looking into both. kind of been playing around with this as well: str = _url; slash = str.lastIndexOf(/); str = str.substring(slash+1, str.length); dot = str.lastIndexOf(.); filename = str.substring(0, dot); directoryLocation = _url.split(filename + .swf).join(); and setting it to frame 1. On Wed, Jun 3, 2009 at 2:15 PM, Robert Leisle b...@headsprout.com wrote: Hi Maurice, How about sending it in as a URL variable when you load preloader.swf into the html page? In the HTML: object . param name=movie value=swf/preloader.swf?path=swf/ / ... embed src=swf/preloader.swf?path=swf/ .../ /object Then in preloader.swf: var ojtParams:Object = this.loaderInfo.parameters; var swfPath:String = ojtParams.path; hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of maurice sallave Sent: Wednesday, June 03, 2009 1:30 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] swf paths... Hello! First time on here, so thanks for any advice. I'm pulling in a preloader.swf file into an html file that sits at root swf/preloader.swf. All my swf's are located in a swf directory that gets preloaded into this preloader.swf - simple enough. I'd like to try to keep my server as clean as possible without having to hard-code the path into the preloader.swf file and don't want to use flashvars as a way of referencing my targeted path. Is there another way of doing this? Of course if I put the html file inside the swf directory, everything works, but it defeats the purpose of keeping my server organized. I hope this makes sense and again thanks in advance. ___ 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders