I like to import a textfile to flash and then parse through it to sort out keywords. Is it possible to sort out characters too like you can with the c-command getchar?
A couple of functions that might help - the first looks for a word and splits the input phrase up into an array around the keyword, the second grabs each character in succession.
Code:
formatText = function (input) {
var tempArr = input.split("to");
trace(tempArr[0]);
trace(tempArr[1]);
};
//
getCharacters = function (input) {
for (var i = 0; i<input.length; i++) {
trace(input.charAt(i));
}
};
//
string = "text string to be formatted by function";
formatText(string);
getCharacters(string);
To load the textfile into Flash in the first place you have to have its contents in the form of a variable anyway and Flash will read that as a string by default.
So your textfile would be set up something like this:
Code:
&textContent=all of the text that I want to parse in Flash...
When Flash reads this in the variable 'textContent' will contain all of your data and you pass that variable to the functions for parsing.
If you want to add more variables you could have:
Code:
&textContent1=some of the text that I want to parse in Flash]&textContent2=more of the text that I want to parse in Flash
This works out fine but the problem is that I don´t set up the textfile for myself. The file is my downloadeded e-mails who are saved by Outlook express into an textfile. Maybee you know how to automate the textfile so it always begins with &textContent every time it´s updated by Outlook? An even better solution could be to not using the Outlook at all and instead writing a program in actionscript who login to my mailserver and get the e-mails directly to my Flash application. Do you know how to do this or where I could find out?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.