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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically get text from website & display in standalone app

Status
Not open for further replies.

orangejuice

Technical User
Nov 18, 2002
33
0
0
CA
Ok - maybe this has been answered somwhere already, but here's my problem:

I have a standalone CD project created completely in Flash and would like to display my current news items from my website in the Flash interface. Rather than just having a link to the correct webpage in my site, I want Flash to automatically go to my web server, grab the html from the designated page, and display it in a movie clip, or something. Then, if the links in the html ("more info", etc) are clicked, it would bring up a web browser screen with the correct html page - directly from our site. This way, if someone looks at the CD a year from now, the news items shown will be current.

Is this possible?? If so, have any examples or suggestiosn on how??

Thanks for any help!
 
sounds doable and easiest if the news info in flash is loaded from a database or an external text file. ought to be able to return the variables with a server side script.

of course if the user aint connected you are stumpted because i doubt you could force a connection

that said what about something like this

lv = new LoadVars();
lv.onLoad = function(success){
if(success){
// the trip to and back from the server was a success
if(lv.Num > 0){
// there are vars to process
for(x=0;x<=lv.Num;x++);
// next line assumes that we have textboxes
// with instance names of &quot;TextBox1&quot;, &quot;TextBox1&quot; etc
// and that the returned vars are &quot;news1&quot;, &quot;news2&quot; etc
_root[&quot;TextBox&quot; + x].Text = lv[&quot;news&quot; + x];
}
}else{
// no data to return
}
}else{
// the trip to and back from the server was NOT a success
// the not connected scenario
}
}
lv.sendAndLoad(&quot;myWebPage.php&quot;,lv,&quot;GET&quot;);


not sure if thats exactly what you want or not but it might be a step in the right direction.
 
That looks like it might work. Do I need to define the lv variable somwhere in my text file?? Or can I just set up the text file as:
news1=Blah blah blah&news2=Dum de dum

Thanks!
 
yip that looks fine for the text file. just direct the sendandload statement to the full url of the server script that will open and read the text file...and keep fingers crossed.

and as you are just recieving info and not sending anything maybe just a load statement would be all you need. you might be able to get away with just loading the text file.

lv.load(&quot;
i would test both anyway and see which works best.
 
Yup it showed up fine. Mine seems to be working alright as well - only problem is that I wanted to have some html links inside the text, but they just seem to show up as the entire <a href... listing. Any suggestions?
 
just make sure the textbox has an instance name and set html to true or click the little html icon on the textbox, as things stand looks like your text box is not set to take html
 
Thanks - just figured that out myself!! Thanks for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top