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 8651839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:10:01+00:00 2026-06-12T14:10:01+00:00

In ActionScript, it is possible to check the type at run-time using the is

  • 0

In ActionScript, it is possible to check the type at run-time using the is operator:

var mySprite:Sprite = new Sprite(); 
trace(mySprite is Sprite); // true 
trace(mySprite is DisplayObject);// true 
trace(mySprite is IEventDispatcher); // true

Is it possible to detect if a variable (extends or) is a certain class or interface with TypeScript?

I couldn’t find anything about it in the language specs. It should be there when working with classes/interfaces.

  • 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-06-12T14:10:02+00:00Added an answer on June 12, 2026 at 2:10 pm

    4.19.4 The instanceof operator

    The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, and the right operand to be of type Any or a subtype of the ‘Function’ interface type. The result is always of the Boolean primitive type.

    So you could use

    mySprite instanceof Sprite;
    

    Note that this operator is also in ActionScript but it shouldn’t be used there anymore:

    The is operator, which is new for ActionScript 3.0, allows you to test whether a variable or expression is a member of a given data type. In previous versions of ActionScript, the instanceof operator provided this functionality, but in ActionScript 3.0 the instanceof operator should not be used to test for data type membership. The is operator should be used instead of the instanceof operator for manual type checking, because the expression x instanceof y merely checks the prototype chain of x for the existence of y (and in ActionScript 3.0, the prototype chain does not provide a complete picture of the inheritance hierarchy).

    TypeScript’s instanceof shares the same problems. As it is a language which is still in its development I recommend you to state a proposal of such facility.

    See also:

    • MDN: instanceof
    • TypeScript’s docs: instanceof Narrowing, which shows how instanceof can be used to narrow things
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible using actionscript to determine what operating system the flash projector is
Possible Duplicate: How do I linkify text using ActionScript 3 I am using a
i wanted to know that using actionscript, is it possible to send email and
Is something like this possible in Actionscript? Java: URLFetcherFactory.setCreator( new IURLFetcherCreator() { public IURLFetcher
Is it possible to have two text colors in one text field using Actionscript
I'm building a flex application using the http://code.google.com/p/facebook-actionscript-api/ library. Is it possible to get
Is it possible to get the bitmap data from a component using ActionScript? I
I'm completely new to Actionscript and I'm trying to figure out if it's possible
Is it possible, using actionscript 3 to disable the right click menu? Any help
What audio data can I get using actionscript? Is it possible to get tones

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.