I’m having a problem…
Flash keeps wanting to put double spaces into dynamically loaded text. .txt files and also text brought up for a MySql database. Any ideas?
Also, does anyone use Flashloaded’s UltimateScroller component. I have a couple questions that the people at their forums can’t answer. It doesn’t want to scroll dynamically loaded text.
Ok…that’s all. Thanks! HAPPY EASTER!
~Troitone~
You have to use some character to repersent a enter before putting it into the DB. Basically find all the
and replace them with a really wierd character of your choice and when the file is loaded into flash just go though and parse it out and do the opposite (replace all wierd characters with
);
post your PHP, and also a link to what the php outputs
This is what my site uses for the flash CMS.
//CONVERT THEN SEND
tarray = new Array();
tarray = _root.textbox.text.split("");
var i = 0;
var tnewstring = "";
while (i<tarray.length) {
if (tarray* == "
") {
tarray* = "»";
}
tnewstring += tarray*;
i++;
}
//send to php here so it can be placed in either a DB or .txt
//Put from .text to textbox.text.
tarray = new Array();
tarray = this.info.split("");
var i = 0;
var tnewstring = "";
while (i<tarray.length) {
if (tarray* == "»") {
tarray* = "<br>";
}
tnewstring += tarray*;
i++;
}
textbox.text=tnewstring;
//Put from DB to textbox.text.
tarray = new Array();
tarray = variablewithcontent.split("");
var i = 0;
var tnewstring = "";
while (i<tarray.length) {
if (tarray* == "»") {
tarray* = "<br>";
}
tnewstring += tarray*;
i++;
}
textbox.text=tnewstring;
And just to let you know if you want you can make a .php file and just load
//Generate your file from the mysql DB then load it in.
var r = Math.random()*9999;
loadText = new LoadVars();
loadText.load("generatedtextfile.php?page=home&r="+r);
loadText.onLoad = function(sss) {
//script
};
sounds like dodgy characters to me. If you use text wrangler or bbedit, open your file as a text file and click “zap gremlims”. your textfile will now show you how it will display in flash.
If you can help it… dont copy and paste from any microsoft programs.
If you must, copy from microsoft into a plain text editor then copy and paste again to you final file.