I have a problem,
I'm making this message cycling headline popup thingy.
This is my code for one of the frames:
Let's say that i declared a variable "headline1 = "Hello Everybody!"
on one frame. I have a counter called "hnews" as well that starts at 0 and goes to a limit.
the next frame i have
PHP Code:
var x = "headline"+_root.hnews
scroller.thenews = x;
I want the scroller to be equal to the variable headline1, not the string headline1. I've tried hundreds of things like brackets and curly braces, but all in vain.
Plz help,
Danny
K2xL - My games, tutorials, message boards, and experiments. Blog
Sweet, thanks,
but i have another question now...
I tried making an array and a for loop to load variables from a txt file.
PHP Code:
loadText = new loadVars();
loadText.load("Variables.php");
loadText.onLoad = function(success) {
if (success) {
headlinecount = this.headlinecount; //total number of headlines
headline = new Array(headlinecount);
for (a=0; a<headlinecount; a++) {
headline[a] = this.headline[a]); // < - here is problem
}
Use a for in loop to pull out all the data from the textfield then you won't need to know how many exists in the file. If you need to use the value later, increment a counter in the for in loop and reference to that.
I'd personally use XML for this, then you can use childNodes.length to specify the for loop's properties, but I like whoring XML everywhere I go. It's worth looking up though to replace usage of textfiles...