AS3 self-writing class collation Notes dot class 1th/2 page _flash AS3

Source: Internet
Author: User
/upload/20080604194652471.swf
Constructors
Public Function Dot (x_:number = 0,y_:number = 0,_islisten:boolean = False)
The first two parameters represent the initial position of the dot, and the third parameter indicates whether it is a powerful point
If False, the event is not published when the XY changes, and true to publish the event,

Bind bind Display Object method
Public function bind (_dis:displayobject,isintime:boolean = false): void
When the dot binds to the displayobject, the XY property of the dot changes as _dis changes
The first parameter is the bound object, and the second argument indicates whether to bind immediately
If the XY property for False,dot does not change as the _dis changes, but when you get the XY property of the dot, or when you call the dot's method, it changes immediately and is based on the XY property of _dis
If the XY property for True,dot changes immediately as the _dis changes, and if Islisten is true, an xy-changed event is immediately released, equal to the XY properties of the display object, and an immediate response after the change is made

Updata Refresh Method
Public Function Updata (): void
To update the XY properties of a display object and dot

From returns the distance between two points
Public function from (_dot:dot,isquadrant:boolean = false): number
The first parameter represents the end point, and the second argument indicates whether it is a true distance
If False, the two-point distance returned is definitely a positive number, referring to the absolute distance between two points
If true, returns relative coordinates, then it is possible to be negative!

Angle returns the angle formed by two points
Public function angle (_dot:dot,isradian:boolean = false): number
The first argument represents another point, and the second argument indicates whether it is a radian value
The return angle is the true angle value of the relative time, and the specific numerical changes can be seen from the example above

Quadrant returns the quadrant where the relative point is
Public Function quadrant (_dot:dot,ismaster:boolean = true): int
The first parameter represents another point, and the second parameter indicates whether the point is the standard, see the example
Returns 0, indicating that two points are on the same horizontal or vertical line.
Returns 1, indicating that in the first quadrant, a return of 2 indicates the second quadrant ... The highest is the fourth quadrant.
Do not know what the quadrant means, please see this click to jump "Quadrant" of the Baidu Encyclopedia page

Clear method
Public Function Clear (): void
Empty Display objects

Length property (Read only)
Public function Get Length (): number
Gets the distance of the point from 0, 0 points

X Property
Public function set X (num:number): void
Public function Get X (): Number
Sets the X property and, if Islisten is true, publishes X-changed events

Y property
Public function set Y (num:number): void
Public function Get Y (): Number
Sets the Y property, and if Islisten is true, the event y changes is published

Islistener Property
public Var Islisten:boolean
Specifies whether to set the value of the Islisten, which is a listening xy

current 1/2 page   1 2 Next read the full text

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.