Import .txt file as a array! (multidimensional)
Ok- this is a program for self use, so i can just have the outside .txt file in the same folder as the .fla (i know this.)
So- how to format the .txt file so that when i do this:
Code:
loadVarsText = new LoadVars();
loadVarsText.load("Rapsodygap.txt");
loadVarsText.onLoad = function(success) {
if (success) {
trace(this.gap);
}
}
firstdata = this.gap[0,1]
I want rapsodygap.txt to look and do something like this:
Code:
&variablename= [[1.307,1],[1.407,2],[1.503,3]]
Practical aspect- i'm getting the program to import this text file, and i'm gonna do some calculations with the arrays (first number is a time (in ms) 2nd number is how many beats this is away from the last one.)
its a bpm caculator, but VERY EXACT, for when checking the waveform of audio.
I could do it with calculator, but the point is that i'm about to attempt a 17 minute song, and so i need a program to do the calculations. I HAVE IT ALL CODED NOW ALL I NEED IS TO IMPORT MY ARRAYS!!!! *sighs*