What would cause external swfs to suddently not display when a movie is published?
My external swf's are getting loaded and added to the stage when I test/ CTRL + Enter the movie, but when I Publish/ F12 the movie directly in Flash, or import the main swf into Dreamweaver and publish my page from there, my external swfs are not showing up.
I've three external .swfs, one is a collection of buttons, the other two each contain TLF Text dynamic text fields.
If your swf is located in a separate folder than the html page that loads it, that can be the source of the problem. Anything an swf file loads needs to be targeted as if that swf is in the same folder as the html page that embeds it (it doesn't have to be in that same folder, it just has to act like it is).
Problem solved. I basically started from scratch, moving bits and pieces of the movie to a new version.....
You were of course correct, Ned, regarding the location of the main .swf in relation to the html page that loads it -- that was my first mistake.
I got the gist of the rest of your explanation when I did a little "substitution" in my mind when looking in each of the external .swfs at the path in relation to the main movie's .swf.
Here's my folder structure:
index.html mainMovie.swf /assets /content/ bio.txt news.txt /css/ bioStyle.css newsStyle.css siteStyle.css /fla/ bio.swf networks.swf news.swf
I think my troubles sprang from my calling and loading the related .txt and .css files from the movies themselves, bio.swf and news.swf. In each of the movie's frame 1 I would use the path...
var newsURL:URLRequest = new URLRequest("../content/news_10Feb2012.txt");
thinking because the individual movie was doing the calling and loading the path would need to go from the movie, out of the fla directory and into content.
.... If I instead used
var newsURL:URLRequest = new URLRequest("assets/content/news_10Feb2012.txt");
the movie would publish.
From a best-practices perspective should I be calling and loading related .txt and .css files from the individual movies, or from the main movie, keeping the external swfs empty save for the text fields, scroll bars, background images, etc.?
When it comes to what is best put where you should try to think interms of functional divisions. Ideally, any file you create as a separate swf should be able to be adated for use with any number of other applications.
Just as an example, if one happened to be an mp3 player, then it would be beneficial for you to be able to take that and re-use it at will. So in that sense, it would probably be better to have the files it uses to be processed from within it. But to make it portable/adaptable, you would probably also want to have the ability to feed data to it to define the files that it should target.