views:

81

answers:

1

Hi, My team is working on an ASP .Net project that also uses an SWF file on certain pages. This SWF file accesses COLLADA models located in a resources folder in the project directory. The SWF file works just fine when launched from the Flex builder IDE. When I try to launch the enclosing aspx page from Visual Studio, the SWF file is loaded, but, its unable to access any of the assets from the resources folder.

What could possibly be causing this problem? Is it some security related issue?

Thanks in advance.

A: 

If the resources folder is in one of the "protected" ASP.Net folders (all the "App_*" folders), then they can only be accessed via the back-end ASP.Net code.

Another possibility is that the SWF and the .aspx page are located in different folders on the server - which can complicate where Flash tries to load external assets from.

I always solve this by setting the "base" parameter in my Flash inclusion code. From the Adobe Docs:

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.

With SWFObject, this can be done like so:

var params = {base:'/path/'};
var flashvars = {};
var attributes = {};

swfobject.embedSWF('flashFile.swf', 'id', 250, 250, '9.0.0', false, flashvars, params, attributes);
81bronco