Flash Problem
- Started
- Last post
- 16 Responses
- MIJA
I'm having an issue getting this dynamic text to load properly.
the .swf file on it's own works just fine but once I place that movie into the main .swf file the text doesn't load.
here's the code im using.
System.useCodepage=true;
Field1.html=true;
myLoadVar = new LoadVars ();
myLoadVar.load("textfile.txt");
myLoadVar.onLoad = function (success){
if (success == true) {
Field1.htmlText=myLoadVar.myText...
}
}
- MIJA0
any help with this would be greatly appreciated
- UndoUndo0
remove any spaces from the text file name [if it has any].
- UndoUndo0
is yr variable in the text file called myText? and is a valid name value pair?
- MIJA0
yeah thats fine the movie actually works just fine on its own. pulls the text from the txt file just fine.
It's when I make that movie load in another movie that is the problem.
- unfittoprint0
first:
#1 don't use this:
System.useCodepage=true;save your file textfile in unicode format [ie:notepad in windows]
#2 your load Vars should liook like:
http://pastebin.coconut.se/?id=3…
- MIJA0
any recomendations for the txt file if I'm on a Mac?
TextEdit saves as rtf or word.
So I've been using Microsoft Word.
- acescence0
textedit > preferences > plain text
- System-Idle0
also make sure yr url is correct!
if you load say swf 2 into main swf'
and swf 2 is pulled from another folder you have to write the url in swf 2 as if it is swf 1!hope thats not too confusing
- MIJA0
thanks everyone. Cant fix it until I get home from work.
Unfit, when are you going to write a flash book?
- unfittoprint0
google: http://www.google.pt/search?hl=p…
i noticed you wrote that it worked on it's own.
If the parent file resides in a different directory of the loaded file, you should do the following:
in the parent make somethink like:
path = (_parent == undefined) ? "" : "folder/";
myLoadVar.load(path+"text_file.t...
- MIJA0
unfit,
where would I put that? in a frame in the actions layer?
- unfittoprint0
a online "book" is in the making.
less actionscript, more of a collections of toughts on coding/structure/design/etc...
regarding your question:
your code should always be inserted in a action-only layerin this case, wirte it aboe the loadVars load & onLoad statement.
that's a basic approach.
a better way is for the parent movie to "tell" its "children" whre they're coming from. A global path can be triggered whenever new content is being inserted.
- System-Idle0
[a online "book" is in the making.]
thats great unfit, I will look forward to that :)
- MIJA0
Thanks alot! Wish we could've met when I was in Lisbon last June.
- unfittoprint0
that would have been nice.
by I would never call u 'MIJA'.
- MIJA0
I know I know. It means piss in portuguese right?
Well in spanish it means little girl. (I'm a guy)
for me its the first to letters of my first and last names.