Hartwig
April 26th, 2002, 05:35 AM
Hi!
I've a .txt-file containing variables. The variables are structured like this:
aaa_301, bbb_301, ccc_301
aaa_302, bbb_302, ccc_302
...
aaa_325, bbb_325, ccc_325
To use them in Flash I have to read them from the .txt-file and assign them. This could look like this:
onClipEvent (data) {
        _root.aaa_301 = aaa_301;
        _root.bbb_301 = bbb_301;
        _root.ccc_301 = ccc_301;
        _root.aaa_302 = aaa_302;
        _root.bbb_302 = bbb_302;
        _root.ccc_302 = ccc_302;
        ...
        _root.aaa_325 = aaa_325;
        _root.bbb_325 = bbb_325;
        _root.ccc_325 = ccc_325;
}
Is it possible to use a loop instead of write 301, 302, ...325?
I thought of:
onClipEvent (data) {
for (i=301; i=325; i++){
        _root.aaa_i = aaa_i;
        _root.bbb_i = bbb_i;
        _root.ccc_i = ccc_i;
}
}
Any idea how the code could look like?
Many thanks,
Hartwig
I've a .txt-file containing variables. The variables are structured like this:
aaa_301, bbb_301, ccc_301
aaa_302, bbb_302, ccc_302
...
aaa_325, bbb_325, ccc_325
To use them in Flash I have to read them from the .txt-file and assign them. This could look like this:
onClipEvent (data) {
        _root.aaa_301 = aaa_301;
        _root.bbb_301 = bbb_301;
        _root.ccc_301 = ccc_301;
        _root.aaa_302 = aaa_302;
        _root.bbb_302 = bbb_302;
        _root.ccc_302 = ccc_302;
        ...
        _root.aaa_325 = aaa_325;
        _root.bbb_325 = bbb_325;
        _root.ccc_325 = ccc_325;
}
Is it possible to use a loop instead of write 301, 302, ...325?
I thought of:
onClipEvent (data) {
for (i=301; i=325; i++){
        _root.aaa_i = aaa_i;
        _root.bbb_i = bbb_i;
        _root.ccc_i = ccc_i;
}
}
Any idea how the code could look like?
Many thanks,
Hartwig