How to draw a triangle in a math graph which displays X and Y axis.
相关问题
- Should I wait for Flash Player 10.1 or go with Fla
- How to load flex swf from flash?
- Setting Page Title from a SWF
- Security Sandbox Violation
- Get the print screen image from the clipboard
相关文章
- as3 ByteArray to Hex (binary hex representation)
- getElementById not working in Google Chrome extens
- Libraries for text animation in Flex / Actionscrip
- How to upload BitmapData to a server (ActionScript
- Persistent connections between Flash client and Ja
- How to embed a swf file into html code?
- Web player to use with SHOUTcast
- Flash CS4 + SQLITE
It sounds like you need to know how the drawing API works in Flash. Your question is kind of vague, but this might help to get you started - google "Flash Drawing API" for more information.
I hope that helps, let me know if you have any questions.
NOTE: This solution is using ActionScript 3. If you need AS2 this won't work, and off the top of my head I don't know how to help but you might just try googling "AS2 Drawing API" or something to that effect.
To draw shapes using ActionScript2, you can use the moveTo() and lineTo() methods of the MovieClip object. You can specify line colour and thickness with lineStyle(), or make a solid shape using beginFill() and endFill().
So to draw your graph and triangle you could do the following steps:
Here's how the code might look:
You can click the graph to generate a new random triangle.
(source: webfactional.com)