Jsfl in Flash used to create custom Graduated scale
Related Tags:
Flash in a painting in the Graduated scale. Relatively simple principle, if we use creative tools (scale painting lines, text ...), then seemed to be a bit tedious;
Jsfl If so, can be relatively easy, as it must be resolved in only some painting and calibration lines to create some text.
Here, I wrote a command sequence, very simple to use, Figure:

Code as follows:
Function drawRuler () (
Var _width = Number (result.width);
Var _height = Number (result.height);
Var _grad = Number (result.grad);
Var grad_length;
Var start = 1;
Dom.addNewLine ((x: 0, y: 0), (x: _width, y: 0));
Dom.addNewLine ((x: _width, y: 0), (x: _width, y: _height));
Dom.addNewLine ((x: _width, y: _height), (x: 0, y: _height));
Dom.addNewLine ((x: 0, y: _height), (x: 0, y: 0));
For (var i = _grad * 2; i <= _width; i = _grad) (
Start;
If ((start% 10) == 0 | | start == 0) (
Grad_length = _height/2.5;
Dom.addNewText ((left: i-5, top: grad_length, right: i 5, bottom: grad_length 10));
Dom.setTextString (start/10);
Dom.setElementTextAttr ( 'size', 12);
Dom.setElementProperty ( 'alignment', 'center');
Dom.setElementTextAttr ( 'bold', false);
Dom.setElementTextAttr ( 'italic' false);
Dom.setElementTextAttr ( 'face', 'Times New Roman');
) Else if ((start% 5) == 0) (
Grad_length = _height / 3;
Else ()
Grad_length = _height / 5;
)
Dom.addNewLine ((x: i, y: 0), (x: i, y: grad_length));
)
Dom.selectNone ();
)
Var dom = fl.getDocumentDOM ();
Var lib = dom.library;
Var result = dom.xmlPanel ( "file: / / / ruler.xml");
If (result.dismiss == "accept") (
Fl.outputPanel.clear ();
DrawRuler ();
)
Which xml documents:
<dialog Buttons="accept, cancel" title="刻度尺">
<vbox>
<hbox>
<label Value="宽: "control="width"/>
<textbox Id="width" value="450" size="5"/>
<label Value="高: "control="height"/>
<textbox Id="height" value="50" size="5"/>
<label Value="刻度: "control="grad"/>
<textbox Id="grad" value="5" size="5"/>
</ Hbox>
</ Vbox>
</ Dialog>
Enjoy!
- Custom CSS prepared examples ..
- Use CSS custom attributes Expression forms the background of the definition of volume
- Based on the AJAX jQuery and JSON pure html templates
- Custom css
- How CSS custom show the shape of the mouse?
- Expression of the CSS custom attributes to achieve forms OnMouseOver effects
- Create custom code fragment CSS layout improve development efficiency
- The BLOG "Custom CSS"
- (Original) DataGrid and DropDownList with some custom DataGrid and the use css
- DreamWeaver Web site with custom colors
- In DW8 create custom code fragment - CSS layout improve development efficiency
- CSS custom attributes Expression
- Use CSS, also underlined links Play Custom
- DWMX 2004 Rookie of the custom site
- Using custom CSS style underlined website
- Intermediate HTML tutorial Custom List
- DataGrid and DropDownList with some custom DataGrid and the use css
- HTC unified custom forms with style
- Tag custom category
- CSS Templates channel on April 5 to update increased 22 sets of templates!




