Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flash.display.Graphics;
- stop();
- var data:Object =
- {
- Grain :
- [
- ["Danish Pastry", "D+", 214, 53],
- ["Doughtnuts", "C-", 192, 45],
- ["Muffins", "C-", 470, 848],
- ["Wheat Cereal", "A-", 8.46, 59],
- ],
- Fruit :
- [
- ["Canned Fruit", "A", 194, 262]
- ],
- Milk :
- [
- ["Flavoured Milk", "B-", 208, 250],
- ["Flavoured Yogurt", "B+", 250, 245],
- ],
- Discretionary :
- [
- ["Cake", "C-", 235, 64],
- ["Candy", "C", 37, 7],
- ["Cookies", "C-", 78, 16],
- ["Corn Syrup", "D+", 57, 20],
- ["Granola Bar", "C-", 90, 21],
- ["Honey", "C-", 64, 21],
- ["Ice Cream", "C", 290, 72],
- ["Frosting", "D+", 163, 82],
- ["Jam/Jelly", "B", 56, 20],
- ["Pancake Syrup", "D+", 47, 20],
- ["Pie", "C-", 411, 155],
- ["Pudding", "C-", 126, 97],
- ["Juice Drink", "B-", 104, 248],
- ],
- Misc :
- [
- ["BBQ Sauce", "C", 31, 47]
- ]
- }
- for(food_type in data)
- {
- var arr:Array = data[food_type]
- for (var i:int = 0; i < arr.length; i++)
- {
- var row:Array = arr[i];//for example ["Juice Drink", "B-", 104, 248],
- var dataPoint = new point();
- dataPoint.food_type = food_type;
- dataPoint.food_name = row[0];
- dataPoint.food_grade = row[1];
- dataPoint.food_calorie = row[2];
- dataPoint.food_gram = row[3];
- dataPoint.alpha = 0.8;
- dataPoint.x = (dataPoint.food_gram+50)*1.3;
- dataPoint.y = (stage.stageHeight - dataPoint.food_calorie) -50;
- addChild(dataPoint);
- }
- }
- symbolVV
- var food_type:String;
- var food_name:String;
- var food_grade:String;
- var food_calorie:Number;
- var food_gram:Number;
- function pointClick(e:MouseEvent) {
- Object(root).typeTF.text = this.food_type;
- }
- this.addEventListener(MouseEvent.CLICK, pointClick);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement