This is the solution that I had implemented. The path is stored in the web.xml and passed as a paramter to the component. But it sure seemed like a limitation and poor implimentation.
Thanks
----- Original Message ----
From: Roger Gonzalez <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, March 7, 2006 9:25:27 PM
Subject: RE: [flexcoders] Loading File IO example SWF
----- Original Message ----
From: Roger Gonzalez <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, March 7, 2006 9:25:27 PM
Subject: RE: [flexcoders] Loading File IO example SWF
If you're loading files at runtime, its going to be loading relative to the application, not the component. A component that pulls files over the network is by definition not self-contained. I suggest that you make your component parameterized, and have the application pass down a URL base for the component to use to load from. After all, that whole component directory tree really wouldn't exist at all if you were deploying the app to a server statically compiled, all you would have would be the app SWF. So, you need a more sophisticated deployment strategy.
-rg
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Krueger
Sent: Tuesday, March 07, 2006 5:49 PM
To: [email protected]
Subject: Re: [flexcoders] Loading File IO example SWFRight now fileIO.mxml has to have source="/webapp/com/foo/components/fileIO/fileIO.swf"I would like to create a component (fileIO.mxml) that I can use on any mxml page in any package level and not have to worry about it's relative path to the swf in my component. To me a component should be self contained and that should be fileIO.mxml.Sorry if this doesn't make sense. I am trying to make a package that can be reused over and over in other flex apps. In the other flex apps I have no idea of where in the package stucture this component will be used or what the webapp name will be. So the thought would be everything under com/foo/app would be app specific, but everything else should be reusable.
ThanksJeff
----- Original Message ----
From: Roger Gonzalez <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, March 7, 2006 4:05:24 PM
Subject: RE: [flexcoders] Loading File IO example SWF From empMaint.swf, I'd expect../../components/fileIO/fileIO.swf
or/webapp/com/foo/components/fileIO/fileIO.swfWait, I'm confused. fileIO.mxml contains source="fileIO.swf"?? If so, I suggest renaming things. Are you compiling fileIO.mxml into a separate application, or are you using it as a component from empMaint.mxml? If as a component, then the path of the component containing the source= is irrelevant, its a component, components don't make their own SWFs. The application is empMaint, which is the application path.-rg
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Krueger
Sent: Tuesday, March 07, 2006 1:57 PM
To: [email protected]
Subject: Re: [flexcoders] Loading File IO example SWFThanks for the reply.So let say my application structure is as followswebapp/com/foo/app/employee/empMaint.mxml (This is the page I am displaying)in that page I want to use the fileIO component. That component is locatedwebapp/com/foo/components/fileIO/fileIO.mxml (This is the component that extends loader and is used in empMaint.mxml)webapp/com/foo/components/fileIO/fileIO.swfSo the swf that would be calling it would that be fileIO.mxml or empMaint.mxml? empMaint is the outer most and I think would be the swf calling it and would be the basis for the relative path. The fileIO.mxml is what contains source="" statement. I have tried several values in there with no luck."/com/foo/components/fileIO.fileIO.swf""com/foo/components/fileIO/fileIO.swf""fileIO.swf"
"./com/foo/components/fileIO.fileIO.swf"
"../com/foo/components/fileIO.fileIO.swf"All don't work, only including the web app names seems to work. In the above senario what would you expect the value to be?ThanksJeff
----- Original Message ----
From: Roger Gonzalez <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, March 7, 2006 1:21:42 PM
Subject: RE: [flexcoders] Loading File IO example SWF Its relative to the calling SWF when there isn't a leading '/' in the URL.-rg
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Krueger
Sent: Tuesday, March 07, 2006 9:59 AM
To: [email protected]
Subject: [flexcoders] Loading File IO example SWFI was wondering if anyone can help me understand something about the file io example on the macromedia website.There is a swf file that exposes the file upload functionality. In the example on the site it gives and example withLoader source="fileIO.swf"That works fine if everything (mxml page and all components) are in the root of your application. But in practice you will always have packages. As soon as you move the swf to say \ com\ foo\ fileIO.swf you have to set the source="/WebAppName/com/foo/fileIO.swf". I don't understand the need for the web app in the path. Probably because it is requesting that swf via HTTP, but if that is the case why don't you need it when it is in the root?I use a loader control in a different area, but I load that control through actionscript using controlName.load(""); In that instance I don't have to pass in a fully qualified path, or one with my web app name. I have also tried putting the swf under user_classes all with no luck.Has anyone else had this problem, using this example, or have suggestions??ThanksJeff
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

