Copy link to clipboard
Copied
dear my friends
I have a big problem with as3. I have two .swf file : 1- Index.swf and 2-page1.swf. Index file has one frame with the following action :
var loader_mc:Loader =new Loader();
addChild( loader_mc );// Add the loader to the display list
loader_mc.load( "d:\\page1.swf"));// Load the file
I upload Index file in my site and it can't load page1.swf.
Please help me.
Best regards
For that you will have to have some web server if you are using Windows you might have IIS or you can choose free one like Apache
You will start the webserver and place the swf file on to wwwroot directory then you will be able to access it using
http://<your IP address>/page1.swf
Copy link to clipboard
Copied
At first when you are loading a swf why you are using absolute path?
because once you upload the swf file to server its path gets changed...
in URL request give the relative path if your swf is ion the same folder then just use the name of swf file which you want to load.
also upload the swf you want to load along with your original swf.
Copy link to clipboard
Copied
Use following code:
var loader_mc:Loader =new Loader();
addChild( loader_mc );// Add the loader to the display list
loader_mc.load( "page1.swf"));// Load the file
Keep this in mind that you will have to upload the other swf in the same folder where your index file is.
Copy link to clipboard
Copied
Dear my friend
I konw that. but I am trying to load local swf to flash. I don't want to upload page1.swf in the server. I want to upload Index.swf to server and keeo page1.swf in my hard drive.(d:). how can O do that?
Best regards
Hanif
Copy link to clipboard
Copied
That is not exactly possible with flash due to security restrictions. ![]()
But what you can do is host this swf on some server and access it or you can also have this swf hosted on your machine.
and use the URL to access it.
In this case your application to work properly, you might need a crossdomain policy file.
Copy link to clipboard
Copied
How can I have this swf on my machine and use the URL to access it? that is so important for me. the reason that I want to do it is that per my swf file is 10MB and I want to give an install file to my users to install the swf files on their system. now they can read the locad files fast. but if I host the swf files on server they can reas them so slowly.
Best regards
Hanif
Copy link to clipboard
Copied
For that you will have to have some web server if you are using Windows you might have IIS or you can choose free one like Apache
You will start the webserver and place the swf file on to wwwroot directory then you will be able to access it using
http://<your IP address>/page1.swf
Copy link to clipboard
Copied
But whatever you have asked for can be done by keeping the files on the same server why you specifically asked for it? ![]()
Copy link to clipboard
Copied
Dear SwapnilVJ
Thanks alot
that works good in localhost. I have to host the files on the user's system beacause of the size of the files.
Best regards
Hanif
Copy link to clipboard
Copied
I have one problem
when I tried to load page1.swf from localhost the following eeror apear :
*** Security Sandbox Violation ***
SecurityDomain 'http://localhost/icdl/030101.swf' tried to access incompatible context 'file:///C|/Documents%20and%20Settings/farahnak/Desktop/Local/Index.swf'
SecurityError: Error #2047: Security sandbox violation: parent: http://localhost/icdl/030101.swf cannot access file:///C|/Documents%20and%20Settings/farahnak/Desktop/Local/Index.swf.
at flash.display::DisplayObject/get parent()
at 030101_fla::MainTimeline/frame1()
Copy link to clipboard
Copied
You will need a cross domain policy file.
See following link for more details:
http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html
Copy link to clipboard
Copied
Dear SwapnilVJ
I can't understand. I attached a zip file for you. please extract it. then copy test.fla in your desktop and copy 030101.swf in wwwroot. then try to load 030101.swf file. I don't know what can I do. Please do it for me. that is so important for me.
Best regards
Hanif
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more