PDA

View Full Version : inporting a direct .txt file...


Qunto
10-16-2002, 07:24 AM
I am wanting to inport a .txt file into dynamic text.. I can't alter the text file in anyway. So i can't put "text=" anywhere.

I am trying with this AS so ar.





function getdata() {

myNews = new XML;
myNews.load("(Link: http://localhost/qunto_news.txt)http://localhost/qunto_news.txt");



myNews.onLoad = function(){


textbox = myNews;
trace(myNews);

}

}

getdata(); {

It inputs it into the flash file, but it doesn't place it inside the dynamic text box,
Also if it is worth anything, it come up with an output box when testing, showing the contents of the .txt

Could some1 help??

Thanks in advance

Qunto

CyanBlue
10-17-2002, 09:05 AM
Howdy... :)

Try this and see if it works...

function getdata()
{
myNews = new XML;
myNews.load("(Link: <a href="http://localhost/qunto_news.txt" target="_blank">http://localhost/qunto_news.txt</a>)<a href="http://localhost/qunto_news.txt" target="_blank">http://localhost/qunto_news.txt</a>");
myNews.onLoad = function()
{
textbox = myNews.toString();
}
}

getdata();

bill1964
10-17-2002, 03:52 PM
try
loadvariables("filename.txt",0);

within filename contents, mytext=bhah..blah

and dynamic textbox with variable set to mytext

works for me

CyanBlue
10-17-2002, 06:50 PM
Howdy... :)

Um... Qunto had some limitation on implementing the regular text file loading, "I can't alter the text file in anyway.", so he is using XML object instead to load whole content of the text file and then assigning it afterwards...