Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5938679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:43:12+00:00 2026-05-22T15:43:12+00:00

When you cast any object to a boolean value you get true if the

  • 0

When you cast any object to a boolean value you get true if the object is not null and false otherwise, I like to change this behaviour for some objects. I want that some objects return false even when they aren’t null

I know that in ActionScript 3.0 we can change some default behaviours of an object using Proxy. Can we do the same for Boolean(object) or object as Boolean? And how this can be done?

I want to ask this after the next thought:

I have this code:

if (someObject)
    someObject.DoSomething();

That’s mean that DoSomething is only called if someObject is not null but that is only because the “real” code behind that is this:

if (Boolean(someObject) == true)
    someObject.DoSomething();

And works because any object is automatically casted to Boolean and the result is true, but if the reference points to null the result is false.

I want to know if I can change THAT behaviour without adding a new function like isTrue(someObject) or something like that.

Thanks in advance, and sorry for my poor English.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:43:13+00:00Added an answer on May 22, 2026 at 3:43 pm

    No, CustomClass(object) and as are cast operators, behavior of both is defined by language. And Boolean(object) is, afaik, global function with language-defined behavior (and there is no function overloading.) There is no class-level operator for type-casting in ActionScript 3.0, you have to implement some property for true/false checks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Object ele=a.get(i); if(ele instanceof java.lang.Integer){//cast to integer: print(found Int); }else{ //cast to string: print(found:
Is there any good practice related to dynamic_cast error handling (except not using it
I want to cast both MenuItem objects and Button control objects to an object
I would like to be able to retrieve the available operators for an object
By way of explanation, take this value type in C#: struct ObjRef { public
Ideally I would like to send an object of type ArrayList<ArrayList<ASimpleClass>> from a remote
I'm setting up a data model in django using multiple-table inheritance (MTI) like this:
I get in my function message array of bytes and type of object, I
I have the following problem when i use the selectManyCheckBox: campaignInformationForm.campaignInformation.googleAnalytics (this are boolean
Is there any way of converting the python socket object to a void pointer.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.