PDA

View Full Version : [FMX] Trying to Animate a dynamically loaded Text



imported_tipusultan
July 21st, 2003, 02:52 AM
Hi there, I am trying to emulate the http://www.fastpay.com/common/images/text1a.gif

except with an external txt file for the animation to read from. ... is this possible to do with flash, i have read a cuple of tutes, but haven't been able to get it working...

Here is what i have so far, I created a dynamic text box and can read in the text using

loadText = new loadVars();
loadText.load("hello1.txt");
loadText.onLoad = function() {
Txt.text = this.Txt;

};

Txt being the name of the instance of my text box....

but see when i try to make this into a symbol or clip, and animate it, i dont see the text anymore :(

can anybody help? plz ?

Thanks a lot in advance for anybody who can help....

e.s.x.s
July 21st, 2003, 04:09 AM
set the dynamic text's character settings to "All Characters" and try again...

e.s.x.s

imported_tipusultan
July 21st, 2003, 10:33 AM
Hey

That didn't work either,.. but thanks for the reply... see whenever I try to convert that box into a movieclip it doesn't show the text anymore...

Can any experts help on this maybe?


Thank again

imported_tipusultan
July 21st, 2003, 08:39 PM
Hi, I stil haven't been able to figure out this, and was wondering if anybody atleast any ideas?

this what i have come up with so far...

_root.text_mc._visible=false;
//loads in and deals with the loaded text
loadVarsText = new loadVars();
loadVarsText.load("hello.txt" );
loadVarsText.onLoad = function(success) {
if (success) {

textHolder= new Array();
//'myWord' is what i named the text as in the .txt file
textHolder = _root.myWord.split(":" );
x=textHolder.length;

for (i=0; i<=x; i++) {
_root.text_mc.duplicateMovieClip ("letter_"+i, i);
_root["letter_"+i].input = textHolder[i-1];
//spaces them out evenly, one on top of the other
if (i != 1) {
_root["letter_"+i]._y = _root["letter_"+(i-1)]._y+_root["letter_"+(i-1)]._height+10;
}
}
} else {

}
}

claudio
July 21st, 2003, 08:41 PM
it doesnt show up because you need to correct the path to the textfield.loadText = new loadVars();
loadText.load("hello1.txt");
loadText.onLoad = function() {
text_mc.Txt.text = this.Txt;
};Where text_mc is the instance name of the movie clip with the textfield inside.

imported_tipusultan
July 21st, 2003, 08:59 PM
Hey Claudio thanks ALOT :)

I can't believe i missed something so small, and went on to create some stupid long code.. hehe


but really thanks alot,... :)

claudio
July 21st, 2003, 09:04 PM
No problem =)

You may want to check this 2 tutorials
http://www.kirupa.com/developer/actionscript/tricks/relativeaddressing.asp
http://www.kirupa.com/developer/actionscript/tricks/root_parent_this.asp