Skip to main content
April 4, 2013
Answered

AS3 issues

  • April 4, 2013
  • 1 reply
  • 551 views

I have a index.swf that is blank and a main.swf that is a website  both files are in the same folder

the problem i have is that in the index.swf i have 1 frame with the following as3 code

var my_Loader:Loader = new Loader();
addChild(my_Loader);

var my_url:URLRequest=new URLRequest("main.swf");
my_Loader.load(my_url);

now if i click on the swf file index.swf it plays no problem but if i try to view it in html it dont load the main swf and play i cannot figure it out it works aslong as i dont view it using html

This topic has been closed for replies.
Correct answer kglad

first, let flash publish your index.html into the same directory as your index.swf and main.swf.  open index.html in your browser.

if there's still a problem, upload the html and swfs to your server and post a link.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 4, 2013

first, let flash publish your index.html into the same directory as your index.swf and main.swf.  open index.html in your browser.

if there's still a problem, upload the html and swfs to your server and post a link.

April 4, 2013

ok after trying some different things i got it to work not sure whay it is working like this

if i change var my_url:URLRequest=new URLRequest("main.swf");

to  var my_url:URLRequest=new URLRequest("http://mydomain.com/swf/main.swf");

it works but not sure if that is a tacky way

kglad
Community Expert
Community Expert
April 4, 2013

your html file must be in a directory that has a swf subdirectory and main.swf is in that subdirectory.  it doesn't matter where your main swf is located as long as the html embedding code is correct (and flash takes care of that).

anyway, you should use a local path:

to  var my_url:URLRequest=new URLRequest("swf/main.swf");