
Welcome Guest
|
#1
|
||||
|
||||
|
I'm realizing I often have no idea how to work with the asynchronous environment of flash.
I'm trying to load a text file into a variable, with this simple method. Actionscript:
public function loadPlainText(strPath:String):String {
var myLoadVars:LoadVars = new LoadVars();
var myText:String;
myLoadVars.onData = function(src:String) {
trace("src = " + src);
myText = src;
}
myLoadVars.load(strPath);
trace("myText = " + myText);
return myText;
}
trace("LPT = " + loadPlainText("a.txt"));Output goes Code:
myText = undefined LPT = undefined src = *contents of the file* Thanks a lot in advance
Last edited by FlashMove : 03-04-2006 at 03:43 PM |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| XML Issue - Text Node Loading as "NULL" | aura9 | Flash MX ActionScript |
10 | 04-29-2005 06:44 PM |
| External Text File String Into A Variable... | Gramophone | Flash MX |
12 | 06-13-2004 03:38 AM |
| Movie clip needs to be controlled by parameters in text file | tonyc | Flash MX ActionScript |
2 | 02-07-2003 11:36 AM |
| Sporadic loading of variables from a text file | dogzi | Server Side | 3 | 11-29-2000 12:13 PM |
| loading variables from an external text file | stereomike | Flash 5 Actionscript |
6 | 09-05-2000 09:34 PM |

Programming Languages



