Need to create a wedge? Here you go. Pretty simple to use.
| view source |
Example:
var wedge:Wedge = new Wedge( startAngle, arc, radius );
This class is modified from AS2 code written by Ric Ewing at formequalsfunction.com. All I had to do is dress it up in AS3 which took just a few minutes – thanks to SourceMate.
I needed this to display the download progress for an image gallery. That’s why there is no manager class to create a series of wedges for a pie-chart. But things like Axiis.org are much better for that sort of thing.





Nice – and useful too – thanks.
If you're using it as a loader though – wouldn't you want it to expand clockwise? or is that just me being a pedant ;-)
@Lawrie, that’s what the client asked for. But you’re right. I should have included a direction. If I ever update it I’ll do that.
And there’s nothing wrong with being pedantic. :)
Cool,i need this was looking around for a while…:)
This is a helpful addition. I've also been looking for something like this.
Hi Dan,
I'm still very green – could these wedges be "skinned"?
thanks,
Mark
@Mark, yes. You have access to the stroke color, strock alpha and thickness. Plus the fill color and fill alpha. If you need more it would be easy to edit the Wedge class to do pretty much anything you wanted to.
“This is a helpful addition. I’ve also been looking for something like this.”
Same here.. and it’s worked really well for me too. Anyone else find this useful?
Great class! Thanks so much. One quick fix though. The variable strokeColor didn’t do anything…you accidentally duplicated _strokeThickness in your lineStyle call.
this.graphics.lineStyle( _strokeThickness, _strokeThickness, _strokeAlpha );
should be:
this.graphics.lineStyle( _strokeThickness, _strokeColor, _strokeAlpha );
@Jim – Thanks, copy/pasting code usually leads to more errors and bug fixing than it’s worth. I should really try to get out of the habit of doing that. :-)
polygeek recently posted..Available mapping APIs for the Adobe Flash Platform