# AS1 Class with AS2 Intrinsic counter-part

**URL:** <https://forum.kirupa.com/t/as1-class-with-as2-intrinsic-counter-part/210767>\
**Category:** flash\
**Created:** [December 21, 2006, 10:03pm UTC](https://forum.kirupa.com/t/as1-class-with-as2-intrinsic-counter-part/210767 "2006-12-21T22:03:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![drukepple](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/drukepple/32/3115_2.png) [@drukepple](https://forum.kirupa.com/u/drukepple)\
**Post date:** [December 21, 2006, 10:03pm UTC](https://forum.kirupa.com/t/as1-class-with-as2-intrinsic-counter-part/210767/1 "2006-12-21T22:03:55Z")

</div>

I’m hoping someone can help me out, here.

I’ve written an AS1 class, so that it can be uses prior to the class export frame (it’s used in the preloading process). I thought, hey, why don’t I try using an AS2 intrinsic class to get compile-time checking? I got that working halfway…

The _instance_ properties are checked. But the _static_ ones are not. This appears to have to do with the fact that when I say Foo.nonexistent\_prop, it’s looking at Foo, my AS1 class, and not \_global.Foo, the imported AS2 intrinsic class (it’s not _really_ there, but that’s where it would be if it were a regular AS2 class).

I’ve trying creating Foo as my AS1 class then setting \_global.Foo = Foo, I’ve tried Object.registerClass(“Foo”, Foo), and endless variations on different ideas.

My current workaround is to use

```auto
Foo.__resolve = function(name:String) {
    trace("Oops, " + name + " does not exist.");
}

```

Which gives me runtime checking, but I’ve got a lot of static “constants” defined in this class and it would be great to have full-on AS2-style compiler checking.

Any ideas? Thanks…
