Loading external data into a nested .swf

Okay, I am going crazy here! I have read that when using macromedia’s components in a .swf that is nested in a main .swf you must also embed the component in the main .swf as well.

Here is my issue. I have a dynamic text box that loads text from an external .txt file. This works fine when I play it directly in the browser, but I am needing to load this .swf into another first.

The structure is like this…

main.swf > subcontent.swf < data.txt

Is it possible to load the data in a nested movie?

My code in subcontent.swf is as follows.

[color=dimgray]var format = new TextField.StyleSheet();
var path = “flash.css”;
format.onLoad = function(success) {
if (success) {
output.styleSheet = format;
loadText = new LoadVars ();
loadText.onLoad = function (success){
if (success) {
output.variable = “datatxt”
output.htmlText = loadText.datatxt;
} else {
output.htmlText = “ERROR LOADING CONTENT”;
} else {
output.text = “ERROR LOADING CSS FILE”;
[color=black]Again, this works fine when played directly in the browser, its only when loaded into another .swf that the external data is not able to be retrieved.[/color]

Please help!!!


it’s been my experience that you don’t really need a new LoadVars() definition… if you just go loadVariablesNum(“path.txt”) it works just fine. a while ago i did a flash site loading external xml, and i had problems with the actual location of the xml documents… play with the location of the txt file (like put …/data.txt) and see what you get…

if you say it works fine by itself, then it must be where you are telling flash to get the files from.

lemme know if it works for ya.

Thanks for the reply. I actually relized that the dynamic text was masked, therefore it appeared as if it was not loading when it fact it was I simply could not see it because of the mask.

Thanks for your help!