;

PDA

Click to See Complete Forum and Search --> : Import Text into Kool Moves


drupopuppis
04-08-2006, 03:11 AM
I have followed all the instructions from the tutorial but still I cannot view it correctly...any help?

blanius
04-08-2006, 10:43 AM
What tutorial is this from? It's wrong. The second paramter in the loadVariables is not the movie to load them into it's the method either POST or GET

So that should read loadVariables("text.txt","GET")

Here's an example from the livedocs at Macromedia

this.createEmptyMovieClip("target_mc", this.getNextHighestDepth());
target_mc.loadVariables("params.txt");
function checkParamsLoaded() {
if (target_mc.done == undefined) {
trace("not yet.");
} else {
trace("finished loading. killing interval.");
trace("-------------");
for (i in target_mc) {
trace(i+": "+target_mc[i]);
}
trace("-------------");
clearInterval(param_interval);
}
}
var param_interval = setInterval(checkParamsLoaded, 100);

You can't use the trace lines but change them to dispay in a editbox with txt1.text= instead...

BUT BETTER YET
Use the loadVars that is available since flash player 6 it offers Much better functionality



You can use the LoadVars class to obtain verification of successful data loading and to monitor download progress. The LoadVars class is an alternative to the loadVariables() function for transferring variables between a Flash application and a server.

The LoadVars class lets you send all the variables in an object to a specified URL and to load all the variables at a specified URL into an object. It also lets you send specific variables, rather than all variables, which can make your application more efficient. You can use the LoadVars.onLoad handler to ensure that your application runs when data is loaded, and not before.

The LoadVars class works much like the XML class; it uses the load(), send(), and sendAndLoad() methods to communicate with a server. The main difference between the LoadVars class and the XML class is that LoadVars transfers ActionScript name and value pairs, rather than an XML Document Object Model (DOM) tree stored in the XML object. The LoadVars class follows the same security restrictions as the XML class.

Availability: ActionScript 1.0; Flash Player 6

Here's the link to the liveDocs for LoadVars. I reccomend you look it over as with loadVars you can load things like complete text files and as I just learned in another thread you could load a CSV file with this.
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?href=00002323.html

drupopuppis
04-08-2006, 10:54 AM
So this works in Kool Moves?

drupopuppis
04-08-2006, 11:02 AM
I have tried with "get", .......what happens now is that it opens the text file in a separate window, the flash object is still empty...mmhh!

Chris_Seahorn
04-08-2006, 11:27 AM
Well, that was interesting.

http://sandbox.blogdns.com/examples/LOADTEXT1.html

You are initiating the loadVariables in a frame where the text field does not exist. I placed it in frame 1 also. I also made it's variable name "mytext". This is to match the variable name in the actual text file which I changed to:

&mytext=This text is a variable that will appear in my new Kool Moves Movie.&
Also, try to avoid using the word "text" as a variable name and treat it as a reserved word.

Your using loadVariables is fine and plenty of people still use it. The actionscript on frame one is now:

this.loadVariables("http://sandbox.blogdns.com/examples/text.txt","GET");

You should of course replace my url with yours or a relative path.

drupopuppis
04-08-2006, 12:38 PM
YAHHHHHHHHHHHHHHHHHH...................

You made my day..........besides, what version of koolmoves do you have?

Chris_Seahorn
04-08-2006, 12:42 PM
5.2.3

You can pretty much recreate it in any version with the pasted code above.

Chris_Seahorn
04-08-2006, 12:44 PM
My bad. I'm on 5.2.5

drupopuppis
04-08-2006, 12:55 PM
I wonder if I can write HTML (links and more) in to a text file that load to a flash object in kool moves......anyone?

Chris_Seahorn
04-08-2006, 12:55 PM
Yep

Chris_Seahorn
04-08-2006, 01:14 PM
**Flashplayer (depending on the version) only supports certain tags. Visit the Macromedia website for a list of tags allowed in the different versions**


Open the properties panel for that dynamic textfield and change "Has A Border" to "No" and "Has HTML" to "Yes":

http://sandbox.blogdns.com/examples/loadtext2.jpg

Then change your textfile to this:

&mytext=<a href="http://www.koolmoves.com" target="_blank"><u>This text is a variable that will appear in my new Kool Moves Movie.</u></a>&

drupopuppis
04-08-2006, 01:36 PM
I got it.....thannx....I can sleep better now...