Hi! I’m thinking about the solution for a long time, but I don’t know flash well, I hope maybe someone can have an idea, or have done this before.
I have results of televiewers phone voting in XML file. I need to get it from file and show it graphically.
The needed shape is a sector of circle, which should change it’s width corresponding to percent of votes for this variant. I’ve attached a screenshot from Flash.
I’ve drawn the shapes via the following code:
var circle1:MovieClip = new MovieClip(); circle1.graphics.beginFill(0xFF0000); var r11:Number = 150 - per1*1.3; var r12:Number = 150 + per1*1.3; circle1.graphics.drawCircle(0, 0, r11); circle1.graphics.drawCircle(0, 0, r12); circle1.graphics.endFill(); circle1.x = 0; circle1.y = 540; addChild(circle1); var triangle1:MovieClip = new MovieClip(); triangle1.graphics.beginFill(0xFF8000); triangle1.graphics.drawTriangles( Vector.<Number>([0,540, 250,420, 250,660,])); addChild(triangle1); circle1.mask = triangle1;}
What I need next (and have no idea how to do that) is to update data from XML once per some short period and also to animate changes graphically – not to redraw new shapes at the moment, but to create kind of motion tween between old and new values.