|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Enthusiast
![]() Join Date: Feb 2003
Location: Taunton
Posts: 28
|
Hi Guy's and Gall's
I have a couple problems, i imagine probably easily fixed, but over my head ![]() Number 1... My flash movie loads an external text file on loading, then display's it in another scene in a scrolling box. The problem is all the line breaks, it seems to add 2 for every 1, is that to do with the text file? or have i missed something in flash? can i remove them with action script? Number 2... The Flash movie doesn't reload the text file every time you oven the page, it seems to open a 'cached' version, can i do anything about this? www.bexinoz.com Thanks in anticipation of any help you guys can give me! Andy |
|
|
|
|
|
#2 |
|
Drupaler
![]() Join Date: Jul 2002
Location: London, UK
Posts: 3,299
|
Regarding the caching, the usual trick is to make sure that the URL changes slightly each time to fool the browser. Do this with a querystring. It doesn't have to do anything. You could generate it randomly with JavaScript, so that your Flash page URL is maybe something like:
Code:
http://www.yoursite.com/flash.html?14526 |
|
|
|
|
|
#3 |
|
Dumb PHP codin' cat
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2000
Location: San Diego, CA
Posts: 5,460
|
As for the two line breaks between paragraphs. Its because windows newlines are \r\n and so flash interprets that as two line breaks.
I have written quite a bit on this subject over at actionscript.org Code:
function loadText(txtFile, target) {
myVars = new LoadVars();
myVars.load(txtFile);
myVars.onData = function(raw) {
var tmpText = "";
if (raw.indexOf("\r\n") > -1) {
tmpText = raw.split("\r\n").join("\n");
}
else tmpText = raw;
target.text = tmpText;
}
}
loadText("myText.txt", _root.myText);
Code:
Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am v Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am Yo I am some text with windows line breaks, yes I am v |
|
|
|
|
|
#4 |
|
SitePoint Member
Join Date: Apr 2004
Location: Plymouth, NH
Posts: 5
|
I currently have a dynamic textbox with an actionscript input of:
t = "Text1\nText2\n\n"; text = t; What I would like to do (keep in mind this box is linked with a scroll bar but it should not matter) is have Text1, Text2, etc. called from a text file called calendar.txt using the code above where I believe I could just list event titles in an organized way and have flash separate the lines for me. How can I make this work? |
|
|
|
|
|
#5 |
|
SitePoint Member
Join Date: Jul 2004
Location: coimbra
Posts: 1
|
hi
try this way t = Text1 + "\n" + Text2 + "\n\n"; text = t; |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 23:10.











Linear Mode
