I used to get tangled up in relative urls a lot so I finally started
passing "root urls" into my application via the wrapper.  I do this for
assets and for my RPC service urls.  One advantage to this is a single
deployment of code can operate as many different applications.  It also
supports multiple launch configurations in Flex Builder, just create a
new configuration an point it to the specific wrapper file.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Brad O'Hearne
Sent: Sunday, October 12, 2008 10:44 PM
To: [email protected]
Subject: [flexcoders] Problems with assets in release build

 

All,

I have a Flex app with assets (images) sitting in an assets directory 
off the project root which works perfect in the debugger. All 
references to images reference source in "../assets/images//<image 
name>" and as stated, it works fine. Additionally, the release build 
also works perfectly when deployed, as long as I deploy to the site 
root. However, I discovered when I dropped the entire app down into a 
site sub directory underneath the web site's document root that it no 
longer finds these assets properly, but looks for them one directory 
above (back in the root). The obvious issue here is that in your local 
project, the src directory puts the Flex code in a directory below the 
root, and therefore, "../assets...." resolves fine, but when deployed 
to a web server, if you put the html file at the root, it exists at 
the same level as the assets directory. The only reason the root was 
working is because the "../" part of "../assets..." cannot refer to 
anything above the root.

This isn't a major problem, fixed by either a) dropping the swf into a 
subdirectory and editing references to it or b) dropping all release 
artifacts into a subdirectory and creating a new index.html. The 
reason I am asking the question is because it seems a little odd that 
the result of exporting for a release build requires manual tinkering 
like this. It seems that you are either in the boat of manually 
changing generated references to the swf, or creating another html 
wrapper / redirect to the generated html wrapper. What am I missing? 
Is there some simple configuration option that rectifies this, so that 
no manual intervention is necessary? The desired outcome is to have 
the generated HTML file which references the SWF be the index.html, so 
that the app loads by default whenever the URL path (minus the 
index.html) is accessed.

Brad

Brad O'Hearne
Owner / Developer
Big Hill Software
ph.480.280.1468
fx.888.600.8806
[EMAIL PROTECTED] <mailto:brado%40bighillsoftware.com> 
http://www.bighillsoftware.com <http://www.bighillsoftware.com>  

 

Reply via email to