Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a dynamic external .cfm file 1

Status
Not open for further replies.

rcusr

Technical User
Sep 4, 2002
26
GB
I have a dynamic external .cfm file with some variables. It outputs a lay out like this:
&count=4&news1="this+is+the+first+news+story"&news2="this+is+the+second+news+story"&news3="this+is+the+third+news+story"&news4="this+is+the+fourth+news+story"&EOF=true

I want to load each of these variables into a dynamic text field in my flash file.. However, I want it done intermittently i.e. add news1 wait 10 or so seconds and then append news2 etc. etc.

the actionscript I'm using is this (but it doesn't work???).
================
news = "";
z = 0;
if (z == 1000) {
for (i=0; i<count; i++) {
[&quot;news&quot;+i].ignoreWhite = true;
newNews = this[&quot;news&quot;+i];
set (&quot;news&quot;, news+newline+newNews);

z = 0;}
} else {
for (z=0; z<1001; z++) {
}
z = 1000;

}
================
How would I change the code so that it does what I'm after?
Thanks,


Richard

 
this will be much closer to what you need

lv = new LoadVars();
lv.onLoad = function() {
theNews =[];
count = lv.count;
for (i=0; i<count; i++) {
var Name = eval(&quot;lv.News&quot;+i);
theNews.push(Name);
}
shownews();
}
lv.load(&quot;news.cfm&quot;);
function shownews(){
display = setInterval(news,1000)
}
next = 0;
function news(){
mytext.text += theNews[next] + newline;
next ++;
if(next==lv.count){
clearInterval(display)
}
}

you will need a dynamic textbox with instance name mytext. set to add a news item every second but change setinterval to control that

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top