Ctrl_Z
1
i’m trying to produce a one frame random quote field
i have a dyn text field “quotebox” with the var of “quotefield”
rn=random(10);
loadText=new loadVars();
loadText.load(“quotes.txt”);
quotern=[“quote”+rn];
loadText.onLoad=function() {
quotefield.text=quotern;
};
that’s what i have for code
on the qoutes.txt file i have quote1-quote10 listed
i can get the quotern to display in the text field but can’t get the quotes in the text field unless i do this
loadText.onLoad=function() {
quotefield.text=quote10;
add the quote# to the code
which then displays the quote
if anyone has any ideas
thanks
system
2
You use quotefield.text, so you’re not using it’s variable. Give the textfield the instance name quotefield. Then try this:
[AS]
loadText=new loadVars();
loadText.load(“quotes.txt”);
loadText.onLoad=function() {
rn=random(10);
quotefield.text=this[“quote”+Math.floor(Math.round(rn)+1)];
};
[/AS]
Forgot to round 
system
4
saweeeeeeeet
thank you very much!!!
both of you
system
6
ok how about this
what if i wanted to add a next button to the movie
_root.next.onPress=function(){
quotefield.text=this[“quote”+Math.floor(Math.round(rn)+1)];
}
is that what i’d use
cause it’s not pulling any text at all with this
system
7
[AS]var index = 1;
next.onPress = function() {
quotefield.text = loadText[“quote”+index++];
}[/AS]
That’s the idea… 
system
8
ahhhh
ok koool
thanks again