• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How does operator 'less than' work with Rectangle objects?

New Here ,
Apr 23, 2014 Apr 23, 2014

Copy link to clipboard

Copied

Just found in legacy code the following:

private var firstRect:Rectangle;

private var secondRect:Rectangle;

if (firstRect < secondRect)

{

// do something

}

How does operator 'less than' work with Rectangle objects?

Doc says that object is converted to number if it is not a String.

Rectangle is not a String, though has conversion to String.

Please help.

TOPICS
ActionScript

Views

246

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 23, 2014 Apr 23, 2014

Copy link to clipboard

Copied

Probably the best thing to do is to try different rectangle values with different operators until you understand it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 23, 2014 Apr 23, 2014

Copy link to clipboard

Copied

Is there are a chance to know for sure how it works instead of bruteforce rectangles?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 23, 2014 Apr 23, 2014

Copy link to clipboard

Copied

LATEST

IME the best way to know for sure is to experiment. The docs are only one person's best understanding of how things worked on the day, which is seldom 100% accurate. I find that even with code I wrote I can't accurately say 100% of what it does until I've worked with it for a while. Keep in mind that the docs are usually written when the code is written, so  never expect more than a rough idea from the docs.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines