• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 296
  • Last Modified:

.txt file is not loading into .swf

I have a .txt file that will load into my .swf when i'm using Flash or I open the .swf in the Flash Player.  When I try to view the .swf through the internet(from my own server that's in my home) the .txt file doesn't load into the .swf.   Everything is in the relative directory so I don't know what else to do, yet.  Any Ideas?
0
GarrettChristopherson
Asked:
GarrettChristopherson
  • 6
  • 3
2 Solutions
 
adler77Commented:
How is everything in a "relative" directory? Are all three files in the same folder, or is the HTML page in one folder and the SWF and TXT file in a subfolder? If it is the latter, you may need to add the subfolder's path in your SWF. Here is what I mean:

page.html is in the main folder, and page.swf and page.txt are in the assets subfolder. If the SWF loads page.txt and assumes it is in the same folder (which it is) it would work fine. Once you load the SWF into an HTML page, that becomes the folder everything is based on. So, in this case, the path would need to be changed to assets/page.txt. Is this similar to your setup?
0
 
GarrettChristophersonAuthor Commented:
Everything is in the same folder.

I neglected to mention previously that the .swf that is loading the text file is being loaded into a preloader .swf.  I bet that has something to do with it, as I've experienced other issues because of this.  
0
 
GarrettChristophersonAuthor Commented:
I just remembered, I have another .txt file that is successfully loading into the .swf! This doesn't make any sense to me!
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
GarrettChristophersonAuthor Commented:
I would post the published files but they are too large to post.  If you give me your email address, I'll send it to you.
0
 
adler77Commented:
Are the two TXT files being opened in the same fashion? What I mean is, if you rename the one that is working and try to load it in place of the one that isn't, what happens?

Also, what indication do you have that the file isn't loading? If you haven't, one way to do this is use the parameter passed to the onload handler. Of course, once you launch from the web, you can't trace. Here is the trick I use (assuming you are targeting Flash 8 or higher), you may have another:

Each load() call has slightly different params. Loading CSS or XML you can use

XMLdoc.onload = function(param) {
     flash.external.ExternalInterface.call("alert", param);
}

Depending on how you load files, calls are different (loadVars and loadMovie have different parameters in their onload handlers--you can look up exactly what they are in the Flash help). For XML and CSS, it is a simple true or false. This will pop up a JavaScript alert. If you have more than one parameter, do this:

flash.external.ExternalInterface.call("alert", param1 + " // " + param2 + " // " + param3);

It is a great debugging tool for when you are working from the web and can't use trace.

Unfortunately, I am in the process of moving and don't have my main computer up and running yet. I can probably take a look if you like in the next few days. Depending on the size of the files, you could zip them up and upload them to a web server (which is probably easiest, and would allow other people to help out as well--just be sure to post the link here!) or send an e-mail to work@maxherzig.com.
0
 
GarrettChristophersonAuthor Commented:
First of all, I know that the files isn't loading properly because a dynamic text box isn't showing the text from the file.  When I rename and switch the files, the file that wasn't loading previously loads, and  the file that was loading previously doesn't load.  Just to be sure, the files loads when I'm testing the movie in Flash, and when I load the .swf in Flash Player the dynamic text box displays the text from the file.  I'll try using the alert box to test some variables
0
 
GarrettChristophersonAuthor Commented:
By the way, I have sent a zip file to the email address you have provided.
0
 
adler77Commented:
OK, I got it; I'll see what I can find. Like I said, I'm moving, so it may be a couple of days before I can get my main computer back up and running again, but I'll try to be sooner!
0
 
GarrettChristophersonAuthor Commented:
Well, thanks for your effort, but I figured out that if you do not embed the characters for the dynamic text box, text won't appear.  I think that was the problem.  It is working now anyway.  Maybe switching around the names of the files did something?? Probably not but that was the only other things that I did to the files!
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now