<p>I want to do this in Actionscript:</p>

<pre><code>typeof(control1) != typeof(control2)
</code></pre>

<p>to test if two objects are of the same type. This would work just fine in C#, but in Actionscript it doesnt. In fact it returns <code>'object'</code> for both <code>typeof()</code> expressions because thats the way Actionscript works.</p>

<p>I couldn't seem to find an alternative by looking in the debugger, or on pages that describe <code>typeof()</code> in Actionscript.</p>

<p>Is there a way to get the actual runtime type?</p>

You'll want to use the Object.prototype.constructor.
From the
documentation
:
```
```
dynamic class A {}
  trace(A.prototype.constructor);      // [class A]
  trace(A.prototype.constructor == A); // true
  var myA:A = new A();
  trace(myA.constructor == A);         // true
```
```
(Conveniently, this is also how to check types in javascript, which is what originally led me to this in the docs)
So, to test this out before I posted here, I tried it in an app I have, in a class called Player.  Since the prototype property is static, you can't call it using "this" but you can just skip the scope identifier and it works:
```
```
public function checkType():void {
    trace(prototype.constructor, prototype.constructor == Player);
    // shows [class Player] true
}
```
```