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: 

Jsfl in Flash used to create custom Graduated scale

  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! 

Related articles:

Search engine optimization
  What is a search engine optimization?    Search engine optimization, also known as site optimization, which is the site be amended or remodeling its search engine friendly, and then to get higher search engine rankings.    Why search engine optimization?    Th...
Back to the design source
  In the world of web design, technology and performance practices all the time quietly off to changes in the update, therefore, fixed design standards also do not exist.    In a complex network environment and fuzzy, only defined the specific contents of the design, designers can be ...
Dreamweaver MX 2004 Video Collection Guide (104)
  Section 104 sets: WWW Service    Curriculum objectives: WWW understanding of the common services.    Curriculum points: This section will introduce the World Wide Web (World Wide Web), IP, domain names, Home (Homepage) Web basic knowledge.    [Full-screen view...
Legend Lixinbeng 50 million after selling what hao123
  Hao123.com masters in the black Lixinbeng Apple sold 50 million now in the busy hao123.com after what, whether, as some people have said every day holding beauty sleep well? Today occasional enquiries ip138.com information, actually This is Lixinbeng found personal website, deeper investigat...
Three minutes in the understanding of the level of relations between the Flash
  In the script more often encountered in the course of this directive _ the official level to us that is:    Id; _ levelN to the root of Timelines are cited.    Must use loadMovieNum () will be loaded to SWF files in the Flash Player, the level before they can use _ to lo...