Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / December 2006



Tip: Looking for answers? Try searching our database.

trying to load external data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
eriesurfer - 12 Dec 2006 02:34 GMT
ive read the tutorials and searched the forums but i still need some help. im
trying to read data from a text file here
(http://www.ndbc.noaa.gov/data/realtime2/41035.spec) what i cant figure out is
how to call each value to its own dynamic text field.
YYYY MM DD hh mm H0 SwH SwP WWH WWP SwD WWD STEEPNESS AVP MWD
2006 12 10 00 00 0.3 0.3 6.2 0.1 3.2 ESE SE N/A 6.1 110
2006 12 09 23 00 0.3 0.3 9.1 0.1 3.6 SE SE N/A 6.2 134
2006 12 09 22 00 0.3 0.3 9.1 0.1 3.6 SE ESE N/A 6.2 125
2006 12 09 21 00 0.3 0.3 7.1 0.1 3.4 ESE ESE N/A 5.9 119:confused;
MotionMaker - 12 Dec 2006 15:55 GMT
You can use XML or LoadVars. LoadVars is the simplier. The example in help is
real good to look at and then you can form a more specific question. But in
general with LoadVars, your file will have a variable associated with each
value and that variable name can be linked to a Flash dynamic TextField.

http://livedocs.macromedia.com/flash/8/main/00002334.html
eriesurfer - 13 Dec 2006 20:52 GMT
hmmm that didnt help.  or i didnt understand it.
MotionMaker - 14 Dec 2006 13:43 GMT
Perhaps the LoadVars.load method documentation may be easier:

http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.htm?hr
ef=00002334.html

Here is the example from that link modified slightly:

var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
    if (success) {
    trace(this.toString());
     textField1_txt.text = this.var1

     textField2_txt.text = this.var2
     textField3_txt.text = this.var3
     textField4_txt.text = this.var4
    } else {
    trace("Error loading/parsing LoadVars.");
    }
};
my_lv.load("http://domain/loadvarsfile.txt");

As you can see in the example you set your dynamic TextFields equal to the
vars in the loaded file.

The other part of the equation is the loaded vars file which might be
var1=1234&var2=Hello&var3=12/1/2006&var4=Blah blah blah
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.