Flash Dot usage

Source: Internet
Author: User
Tags bind

Basic function: record xy two points

Constructor
Public function Dot (x _: Number = 0, y _: Number = 0, _ isListen: Boolean = false)
The first two parameters indicate the initial position of the Dot, and the third parameter indicates whether the Dot is a functional point.
If this parameter is set to false, events will not be published when xy is changed. If this parameter is set to true, events will be published.

Bind binding display object method
Public function bind (_ dis: DisplayObject, isInTime: Boolean = false): void
When Dot is bound to DisplayObject, the Dot's xy attribute changes with _ dis.
The first parameter is the bound object, and the second parameter indicates whether to bind the object instantly.
If it is false, the Dot's xy attribute will not change with the change of _ dis, but when obtaining the Dot's xy attribute or calling the Dot method, changes immediately and uses the xy attribute of _ dis as the benchmark.
If this parameter is set to true, the Dot's xy attribute changes immediately as _ dis changes. If isListen is set to true, the xy change event is also released instantly, so it can listen on the xy attribute of the display object and make an immediate response after the change.

Updata refresh method
Public function updata (): void
Update the xy attribute of the display object and Dot

From returns the distance between two points.
Public function from (_ dot: Dot, isQuadrant: Boolean = false): Number
The first parameter indicates the end point, and the second parameter indicates whether the distance is real.
If this parameter is set to false, the distance between two returned points is definitely a positive number, indicating the absolute distance between two points.
If it is true, the relative coordinates are returned, which may be negative!

Angle returns the angle between two points.
Public function angle (_ dot: Dot, isRadian: Boolean = false): Number
The first parameter indicates, the other vertex, and the second parameter indicates whether the parameter is a radian value.
The returned angle is the actual angle value relative to the time. The specific numerical changes can be seen from the preceding example.

Quadrant returns the quadrant of the relative vertex.
Public function quadrant (_ dot: Dot, isMaster: Boolean = true): int
The first parameter indicates another vertex, and the second parameter indicates whether the vertex is used as the standard. For details, see the example.
Returns 0, indicating that two points are in the same horizontal or vertical line.
Returns 1 in the first quadrant, and 2 in the second quadrant ............ The highest is the fourth quadrant ..
I don't know what quadrant means. Please refer to the "quadrant" Baidu encyclopedia page.

Clear method
Public function clear (): void
Clear display object

Length attribute (read-only)
Public function get length (): Number
Obtain the distance from this vertex.

X attributes
Public function set x (num: Number): void
Public function get x (): Number
Set the x attribute. If isListen is true, the event changed by x will be published.

Y attributes
Public function set y (num: Number): void
Public function get y (): Number
Set the y attribute. If isListen is true, the event changed by y is published.

IsListener attributes
Public var isListen: Boolean
Specifies whether to set the isListen value to listen to xy.

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.