[F8] Scroll text if text.length <= 15
Hi,
I'm trying to get this scrolling text to stop if moving if text.length <= 15
So far this is what I got.
Code:
stop();
var characterLength = this.trackInfo.length;
trace(characterLength);
this.characterLength.text;
/*
if (nodes[i].attributes.track.length>=35) {
infoMarion.trackInfo._x = 0;
} else {
resetPosition();
}
*/
function resetPosition() {
if (trackInfo._width>15) {
if (_root.firstload == true) {
trackInfo._x = 50;
_root.firstload = false;
}
} else {
trackInfo._x = 112-(trackInfo._width/2);
}
}
this.onEnterFrame = function() {
if (this.trackInfo._width>15) {
if ((this.trackInfo._x+this.trackInfo._width)<0) {
this.trackInfo._x = 145;
} else {
this.trackInfo._x--;
}
}
};
See I use var characterLength = this.trackInfo.length; then I put I attach it to this.characterLength.text;
Well the problem I'm having is that I only get the number of characters in my
characterLength.text which is always 0.
I use xml to load into this thing. So I'm thinking that I've gotta grab some info from the XML. I'm just not sure on how to do it.
Download Files Here
This is also good if you want to learn how to communicate From Javascript to Flash. I use it to load music.
Thanks in advance