The source attribute of the <mx:Script> tag and the #include directive refer to files in different ways.
The following are the valid paths to external files that are referenced in an <mx:Script> tag's source attribute:
<mx:Script source="../IncludedFile.as"> is included in "mysite/myfiles/myapp.mxml", then the system searches for "mysite/IncludedFile.as".
For an ActionScript #include directive, you can only reference relative URLs. You can specify file locations relative to the context root (start the location with a slash) or relative to the document root (omit the leading slash), as the following example shows:
#include "/myfiles/functions.as" // Relative to the context root. Resolves to
// /flex_app_root/myfiles/functions.as #include "functions.as" // Relative to the current document root (in this case,
// in the same directory as the current document).
Flex searches the ActionScript classpath for imported classes and packages. Flex does not search the ActionScript classpath for files that are included using the #include directive or the source attribute of the <mx:Script> tag.
Version 1.5
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/15/flex_docs_en/00000052.htm
Comments
yeo_31 said on Aug 14, 2005 at 6:53 PM :