View Full Version : Loading local swf files
SachinSolanki
12-26-2008, 10:47 AM
Hi,
I am trying to load a local SWF file using SWFLoader something like :
myLoader.load("c:/temp/abc.swf");
but i am getting security error # 2148 for accessing local resources.
Please help me to resolve this problem.
Thanks,
Sachin
the binary
12-26-2008, 11:32 AM
did u tried a relative path.. ?
SachinSolanki
12-26-2008, 11:37 AM
The folder where SWFs are located is outside the webserver, so i don't think relative path would work :-/
pixum
12-26-2008, 11:39 AM
heya ... do you use flash or flex? i had some issues with this using flex, and it helped to change the compiler arguments ... let me know, for flex i have something to try ...
SachinSolanki
12-26-2008, 11:48 AM
I am using flex.
I did try changing the compiler options. I used -use-network=false
but it didn't help :-(
pixum
12-26-2008, 12:20 PM
o.k., that was my suggestion, but also make sure you delete this one -locale en_US ...
pixum
12-26-2008, 12:21 PM
if that doesn't help you would need to dig deeper into flashplayer's security settings, and maybe create a crossdomain policy for that one ...
SachinSolanki
12-29-2008, 08:48 AM
Hi Pixum,
Both my flex application and the SWF files are on the same server, but they lie in different folders. I think cross domain policy would not help. Please let me know if you think otherwise.
Also please let me know some workaround if you can.
Thanks,
pixum
12-29-2008, 09:38 PM
heya ... well, i know that problem, and even if the setup looks quite simple, it can be a pain in the ass.
it's all about application domains, so you should take a look at flash.security & flash.system classes for the application domain functions.
you need to take a look yourself, i have no out-of-the-sleeve solution to it, sorry.
i used a lot of times the quick & dirty way of putting all my swfs in a folder structure in my src folder in flex for example. but of course i understand, that this is not always possible. the flash sandbox security settings are on my highest priority list ;) ... i would be thankful if you post your solution when you got it!
SachinSolanki
12-30-2008, 05:29 AM
Hi,
Finally it worked for me :-).
I got the swf file streamed using a JSP and then hit the JSP url to get the streamed swf file. Loaded the streamed swf file using Loader and URLRequest.
The code would look something like following :
var myLoader:Loader = new Loader();
var request:URLRequest = new URLRequest("http://{host}/myApp/myApp.jsp");
myLoader.load(request);
Thanks for all your help friends,
pixum
12-30-2008, 10:15 PM
nice one, sounds much better than my "put it all in the src folder" noob solution :)
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.