PDA

View Full Version : Dynamic text, move.. it wont budge! :P


nicmar
03-26-2003, 01:11 PM
I'm trying to make 3 lines of text, and give them "onEnterFrame" functions.. this is just a test.. it will be more advanced when I get it to work..

The problem with the following code is that it creates 3 textfields as it should, but only the third one moves.. What am I doing wrong?

BTW, the style is defined earlier, so that's not a problem :)


for (x=0;x<3;x++) {
createTextField("land"+x,3200+x,24,22+x*23,200,32);

with (eval("land"+x)) {
embedFonts = true;
setNewTextFormat(style_lacuna);
text = "test"+x;

onEnterFrame = function() {
_x += 10;
}
}


}

zerooito
03-26-2003, 03:47 PM
Try this:


for (x=0;x<3;x++) {
this.createTextField("land"+x,3200+x,24,22+x*23,200,32);
this["land"+x].textColor(0x000000);
with (eval("land"+x)) {
//embedFonts = true;
//setNewTextFormat(style_lacuna);
text = "test"+x;

}


}

onEnterFrame = function() {
for(x=0;x<3;x++)
this["land"+x]._x += 10;
}


It worked fine...

c ya!

Zerooito

nicmar
03-26-2003, 06:23 PM
Hmm.. well.. maybe that works.. thanks.. :)

But the thing is, I want other events for the textfields too.. I'm gonna have:

1. On mouseover (change of alpha)
2. On click (something happens)
3. On mouseout
4. Onenterframe, fade in/out buttons..

So that could be a problem.. but maybe not.. I'll try to use your idea.. I just have a problem with the "with"-command.. :/