Walkem5
asked on
Creating and loading a text field
Hi All,
I am looking for steps on how to create a text field that loads and displays like the ones on www.foreverbrandy.com ... you might have to click on some of the different buttons to get the full effect of how they load (click the life button and then click on bio, journal, etc.) I would also like to incorporate the scroll bar into things so that the text field is already scrollable and I can enter as much information into an external text file as I wish and be able to change things on the fly in the future without worrying about if all the content will fit into the text box. How would I go about doing something like this?
I am sorta a newbie to flash... So steps/code with comments are definately needed.
Thanks in advanced...
I am looking for steps on how to create a text field that loads and displays like the ones on www.foreverbrandy.com ... you might have to click on some of the different buttons to get the full effect of how they load (click the life button and then click on bio, journal, etc.) I would also like to incorporate the scroll bar into things so that the text field is already scrollable and I can enter as much information into an external text file as I wish and be able to change things on the fly in the future without worrying about if all the content will fit into the text box. How would I go about doing something like this?
I am sorta a newbie to flash... So steps/code with comments are definately needed.
Thanks in advanced...
ASKER
Uumm..I'm still not understanding....Is there anyway you can put this in a working example?
Thanks,
Walkem5
Thanks,
Walkem5
try this first:
frame1:
myVar="some text";//mkae this as long as you want and it should scroll
var myformatname = new TextFormat();
with (myformatname) {
font = "Tahoma";
bold = true;
color = 0x999999;
bullet = true;
}
createEmptyMovieClip("clip ", i);
dep = _root.getNextHighestDepth( );
clip.createTextField(["Tex t1"], dep, 0, 0, 60, 30);
clip.Text1.multiline = true;
clip.Text1.wordWrap = true;
clip.Text1.border = true;
clip.Text1.background = true;
clip.Text1.backgroundColor = 0x666666;;
clip.Text1.borderColor = 0x666666;;
clip.Text1.text = _root.myVar;//loaded variable name
}
this.clip.Text1.setTextFor mat(myform atname);
then push ctl-enter and test it - the text should appear in your dynamically created textfield.
toload from outside, make a text file like this:
myVar=some text
and save in same folder as myText.txt
then, before the text creation script, (in frame1 at the top) put:
loadVariables("myText.txt" ,"","GET") ;
Billystyx
ask me about the elements of this you are unsure of:)
frame1:
myVar="some text";//mkae this as long as you want and it should scroll
var myformatname = new TextFormat();
with (myformatname) {
font = "Tahoma";
bold = true;
color = 0x999999;
bullet = true;
}
createEmptyMovieClip("clip
dep = _root.getNextHighestDepth(
clip.createTextField(["Tex
clip.Text1.multiline = true;
clip.Text1.wordWrap = true;
clip.Text1.border = true;
clip.Text1.background = true;
clip.Text1.backgroundColor
clip.Text1.borderColor = 0x666666;;
clip.Text1.text = _root.myVar;//loaded variable name
}
this.clip.Text1.setTextFor
then push ctl-enter and test it - the text should appear in your dynamically created textfield.
toload from outside, make a text file like this:
myVar=some text
and save in same folder as myText.txt
then, before the text creation script, (in frame1 at the top) put:
loadVariables("myText.txt"
Billystyx
ask me about the elements of this you are unsure of:)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Did this help you?
Billystyx
Billystyx
Are you there?
If this has helped can you close the question? O/W let us know what you can't figure out (certain bits/everything) and I will try to explain.
Billystyx
If this has helped can you close the question? O/W let us know what you can't figure out (certain bits/everything) and I will try to explain.
Billystyx
with (myformatname) {
font = "Tahoma";
bold = true;
color = 0x999999;
bullet = true;
}
for (i=num; i<nro; i++) {
this.createEmptyMovieClip(
dep = this.clip.getNextHighestDe
this.clip.createTextField(
this.clip["Text"+i].multil
this.clip["Text"+i].wordWr
this.clip["Text"+i].border
this.clip["Text"+i].backgr
this.clip["Text"+i].backgr
this.clip["Text"+i].border
this.clip["Text"+i].text = _root["myVar"+i];//loaded variable name
}
this.clip["Text1"+i].setTe
this will add a textfield with some formatting - you can just essentially change the text value, or make sure that there is a variable n the root with the name myVar1, for example.
nro is the number of rows pulled from your serverside scripting (from a db for example).
Make sure you pass that to flash at the same time as multilpe variables, so you know how many rows of info you should process. O/w if there is only 1 set of variables you can do away wit the for statement, and hardcode your clip names.
Does this help?
Billystyx