Hi,
I am using actionscript to load random quotes from a text file into a dynamic text box. Essentially this works fine - I press the button and a random quote is pulled from the text file. However, occasionally a little box with a question-mark in it will appear along with the text when I play the swf. I assume this means that somethings within the text file are not recognised. Generally these are “…” “'s” “'v” “-” although this doesn’t occur in every case which is why I am confused.
Does anybody know why this occurs in some cases and not others?
Also, out of curiosity, is there a way to put an extra ‘return space’ into the quotes without messing up the code? like right now they
appear
like
this
but I was wondering if they could
appear
like
this
because some of them are fairly long and it gets slightly confusing sometimes, in terms of readability.
Anyway, I’ve uploaded the text file - any help would be really appreciated - been trying to get this quote page sorted for days ;p
(if it helps the actionscript I used is below - but I’m fairly sure that’s working fine now).
ranQuote = new LoadVars();
ranQuote.onLoad = function(success) {
if (success) {
RanNum = Math.ceil(Math.random()*620);
ran = ranQuote[“quote”+RanNum];
quote_txt.text = ran;
}
else {
quote_txt.text = “Sorry, the quotes appear to have been eaten by a giraffe, please try again later ^^”;
}
}
ranQuote.load(“quotes.txt”);
stop();