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

  • SEARCH
  • Home
  • 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 685241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:54:09+00:00 2026-05-14T01:54:09+00:00

With this code function someFunction(classParam:Class):Boolean { // how to know if classParam implements some

  • 0

With this code

function someFunction(classParam:Class):Boolean
{
    // how to know if classParam implements some interface?
}

i.e. Comparing classParam with IEventDispatcher interface:

someFunction(EventDispatcher) // returns true
someFunction(Object) // returns false

I know it can’t be done with is operator. But, is there a way to do it? Is there a way to know if a class implements some interface? (or is a subclass of another class?)

Possible solutions:

A. Creating an object of classParam and using that object to compare using is operator.

function someFunction(classParam:Class):Boolean
{
    return (new classParam()) is IEventDispatcher
}

B. Using describeType()

function someFunction(classParam:Class):Boolean
{
    var xml:XML = describeType(classParam)
    // found "implementsInterface" value in xml and compare to IEventDispatcher
}

There is a way that DOES NOT USE describeType or creates a new operator?

  • 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-14T01:54:09+00:00Added an answer on May 14, 2026 at 1:54 am

    I don’t see any way to achieve what you’re trying to do except by using describeType.
    It has been created for this purpose, why don’t you want to use it?

    Edit:
    It actually only takes 2 lines to do this :

    var classDescription:XML = describeType(classParam);
    return (classDescription.factory.implementsInterface.(@type == getQualifiedClassName(IEventDispatcher)).length() != 0);
    

    …or just in one, if it’s what bothers you:

    return (describeType(classParam).factory.implementsInterface.(@type == getQualifiedClassName(IEventDispatcher)).length() != 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In this code I created a function called someFunction. Then I modified Function.prototype.apply and
Suppose I have a class like this: function myClass(q) { this.someFunction = function(e) {
I've got this code: function someFunction(something1, something2) { $.post(execute.php, { someData1: something1, someData2: something2
I saw some old code that had: <input type=submit name=submit onsubmit=somefunction(this) /> I was
I'm merging some code and this code's functions are all like this: void someFunction()
I have a JavaScript class that looks like this: function SomeFunction() { this.doSomething(function() {
I have this code: $('.SomeDiv').slideUp(400); setTimeout(function () { SomeFunction(); }, 400); How do I
I have this code: class SomeClass { void someFunction() { Action<string> myAction = (what)=>
I have got this code: function init(){ if (typeof window.jQuery !== 'function') { var
I have this code: function Keyboard() { this.log = $('#log')[0]; this.pressedKeys = []; this.bindUpKeys

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.