Can I invoke a timeline from external array data?

  • d-kam
  • Born
  • Born
  • d-kam
  • Posts: 2
  • Loc: London, UK.

Post 3+ Months Ago

Hello all, forum newbie here! I hope you don't mind that one of my first posts here is so long, however I can't really explain the problem in shorter words.

I'm stuck. I am creating a presentation for a friend who works in the field of science and I've promised results before Friday :eek: These are my goals:

1: To get actionscript to read data from an external array and to have this data interpreted over a period of time.
2: To create a vector map of London divided by postcode (zipcode) so that an area can be highlighted when triggered from the array.
3: To make this all look nice and professional :).

Step 1 is my problem area. I have some script (below) which loads the data in but it does not do so over a period of time so is pointless. For an example of this please see pic1 which is a map of the whole of London in light grey. pic2 is shows what happens when the movie is played, which is that every London postcode is saved as an individual movie (called NW1, E12 etc) with an alpha state of 0 which when triggered from the array is highlighted in red on the map with an alpha state of 100. Hope this makes sense.

Image
pic1

Image
pic2

(Sorry about the pictures but thought it's the best way to explain what I mean!).

Below is an example of the array data in the external text document:

Code: [ Select ]
estados1=
estados2=
estados3=N15=
estados4=
estados5=
estados6=
estados7=
estados8=N22=
estados9=SE1=
  1. estados1=
  2. estados2=
  3. estados3=N15=
  4. estados4=
  5. estados5=
  6. estados6=
  7. estados7=
  8. estados8=N22=
  9. estados9=SE1=


"estados*" is supposed to be a consecutive day reference for the data. There is more data than that I want to represent, 153 lines of it to be exact (152 including zero). As you can see, on some days there is no data. This is the actionscript from the movie:

Code: [ Select ]
dir = new LoadVars();
dir.load("thedata.txt");
dir.onLoad = text;
function text() {
    adjustment = new Array();
    adjustment = dir.estados1.split("-");
    tamano = adjustment.length;
    for (i=1; i<=tamano; i++) {
        color = new Color(adjustment[i-1]);
        map = new Object();
        map = {ra:0, rb:120, ga:0, gb:0, ba:0, bb:0, aa:50, ab:0};
        color.setTransform(map);
    }
}
  1. dir = new LoadVars();
  2. dir.load("thedata.txt");
  3. dir.onLoad = text;
  4. function text() {
  5.     adjustment = new Array();
  6.     adjustment = dir.estados1.split("-");
  7.     tamano = adjustment.length;
  8.     for (i=1; i<=tamano; i++) {
  9.         color = new Color(adjustment[i-1]);
  10.         map = new Object();
  11.         map = {ra:0, rb:120, ga:0, gb:0, ba:0, bb:0, aa:50, ab:0};
  12.         color.setTransform(map);
  13.     }
  14. }


As I said, the movie works except that it does not invoke a timeline at present and simply loads everything in in one chunk. Ideally, "estados1" should be what is represented on the map for frame 1 and "estados2" for frame 2 "estados3" for frame 3 etc. It would be even cooler to have a smooth transition so that if for example postcode N15 is estados3 (day 3) then it fades in on frame 3 and then fades out before frame 4, where the next set of data is represented but that is not as importnant as simply having the data play out. Does anybody here have any suggestions for my actionscript? Any help would be appreciated :)

d-kam.
  • yuriythebest
  • Banned
  • Banned
  • User avatar
  • Posts: 143
  • Loc: Ukraine

Post 3+ Months Ago

nope, sorry. Thef fact of the matter is that if you are a newbie start from the basics.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 4 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.