TwelvestoneFlash

arrays


Sign in

  • Waiting for Godot ( 720 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 4.8 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.8 k posts )
    general front end design an...
  • Back End ( 9.6 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
dazpearce
 
2003-02-06

the following is what im trying to do The aurora are spectacular natural light displays, which are normally only seen at high latitudes. These are caused by energetic particles from the sun streaming down the earths magnetic field lines and bombarding the upper atmosphere. The deposited energy is partly released as photons, which we see as the aurora. Occasionally, it is possible to see these events at mid latitudes, e.g. the UK. This can be predicted using the 3 hourly KP index, which is published on the web going back many years(url 1). 45 day future predictions of KP are also available on the web. The project consists of automatically getting these KP values from the relevant web sites, computing the position of the auroras using formulas, plotting these onto a map of the globe, and producing a web based animation. The user should be able to select past intervals or predict the immediate future

i have written the following code which collects the following info function buttonPressed(buttonInstance){ if (buttonInstance == testButton){ //my button that gathers what the user inputs

// get value of year box year = getValue(); trace("year: "+yearVariable.substr(2,4)); ///input box

// get value of month combobox month = monthBox.getSelectedItem().data; trace("month: "+month);

// get value of date combobox mydate = dateBox.getSelectedItem().data; trace("date: "+mydate);

} } i need the yr,month and date (e.g 02 02 28) to go into an array to go into the the following code that is seperated at the end, i think im not sure. im also not sure how to do it if it is the case

//lets make it an xml object so flash 5 users can do without LoadVars //dataSet = new XML(); //here's where we point to our proxifier, //dataSet.load("http://www.pixelplay.org/jeff/weather/KPproxy.php"); //Lets use the output window using test movie to run the script //trace("LOADING DATA"); //get rid of th first blank line xml puts in //dataSet.ignoreWhite = true; //weeee! let's see if we've got it //dataSet.onLoad = function(success) { //trace("DATA RECEIVED"); //data loading is url encoded, unescape it //dataSet = unescape(dataSet.firstChild).split("\n");

//let's make an example search string now } //recordQuery = "020228"; }here i think //trace("Record date to search for: "+recordQuery); } //call the search function(this can be on a button or whatever later) } //searchData(recordQuery); } //};

this will (if it works) get a line of data from an ftp site which is at ref url 1 im interested in the kp values which are explained in url 2 half way down the page i need to grab the kp values which are 13th-28th in the line of data these numbers correspond to times in the day kp value at 13-14=0000-0300 kp value at 15-16=0300-0600 kp value at 17-18=0600-0900 etc, there is a total of 8 readings taken every day

my second problem (i know, sorry) and this is the biggy my third bit of code // get value of time combobox time = timeBox.getSelectedIndex(); trace("time: "+time);

this combobox gives the user the choice to put in a time (0000-0300,0300-0600) the button is pressed and i get a trace with all the values(02,02,28,1 for example is 2002,feb,28th,0300-0600)

i have no idea how to grab the kp values that correspond to the times input by the user, would it go into another array? would it go into an array at all? how?

can it all be done with the press of one button once the input box and comboboxes are chosen? if anybody is confused i can send my swf file of what i have so far as it doesnt attach on here please help im pulling all my hair out, it will have to be ear hair next!

url 1-ftp://ftp.ngdc.noaa.gov/STP/GEOMAGNETIC_DATA/INDICES/KP_AP/2002.v12 url 2- ftp://ftp.ngdc.noaa.gov/STP/GEOMAGNETIC_DATA/INDICES/KP_AP/kp_ap.fmt

persist
 
2003-02-07

sorry I don't have time to help more with this, but just in case anyone is wondering this url is the code I wrote which loads the data and puts it into an array based on the line breaks.

Then an example date is searched for and the line of data which represents that date is presented. This was an exmaple for Daz to search for data by localizing the data in a xml object.

This line is what needs further breakage. The line is space delimited.

http://www.pixelplay.org/jeff/weather/KP/

Daz, feel free to point to this url to help people help you. I'll keep it up for ya.

In the mean time, it seems like a big hurdle that makes this seem a bit daunting is the amount of stuff you need answered. It may be wise to break up your questions.

The first thing I would do is create this supposed animation from your "formula" from an example set of number s in a string, simply hard coded into the movie.

Once you start being confident you can use the data, your questions I think will begin to be much more specific, and more easily answered, rather than an large overwhelming post with many unknowns.

good luck!

dazpearce
 
2003-02-07

thanks very much thats very kind, im trying to get my head around apache.org at the mo so that i can host it myself, i ramble a bit i know im not after anyone helping me with the formula etc at the mo im just trying to get the no.s i input to the button go into the code so that i can retrieve an the correct kp no, i want to try and do the rest myself, although im not holding my breath as yet

dazpearce
 
2003-02-08

anyone?

mikel
 
2003-02-09

daz: do you know how to use objects? If you want to be able to access a specific piece of data by name try this-

kp=new Object() kp.t1314="0000-0300" kp.t1516="0300-0600" kp.t1718="0600-0900"

variable names cannot begin with a number so i suffixed a "t" then you can reference each one like this

trace(kp.t1314) 0000-0300

is this what you need?

dazpearce
 
2003-02-09

ive sorted it now, but thanks anyway;o) do you know any php?

mikel
 
2003-02-09

what do you need to know?

dazpearce
 
2003-02-09

its ok, ive just had it answered, i do have another question though i understand that flash doesnt handle cross domain restrictions because of security i have a prog that has to get data from another site, but i have to use php to access that site because of this cross domain thing, could u explain (in layman terms) why?

mikel
 
2003-02-09

ok imagine this:

you have an html website that uses cookies to gather user info. you also have space for an ad that comes from a 3rd party banner exchange. when a visitor goes to your page the swf ad is loaded onto the page from a server other than your own. if cross-server communication were possible this swf advertisement could "talk" to the html it is loaded in and record the info back to the server it came from. make sense?

dazpearce
 
2003-02-09

i see, so the ad could in effect 'steal' the user information is that right?

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

arrays