# Linking a SWF with a class on the fly

**URL:** https://forum.kirupa.com/t/linking-a-swf-with-a-class-on-the-fly/297274
**Category:** Uncategorized
**Created:** [September 29, 2009, 1:56am UTC](https://forum.kirupa.com/t/linking-a-swf-with-a-class-on-the-fly/297274 "2009-09-29T01:56:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![galactaphonic](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@galactaphonic](https://forum.kirupa.com/u/galactaphonic)
#### Post date: [September 29, 2009, 1:56am UTC](https://forum.kirupa.com/t/linking-a-swf-with-a-class-on-the-fly/297274/1 "2009-09-29T01:56:07Z")

</div>

I would like to link a loaded SWF with a particular class at run-time.

This is because I would like to have a main SWF with all the code that loads in other SWFs that purely act as graphical skins for the main class. Consequently I would only need to re-export the one file when code needs to be changed rather than have to do a myriad different colour variations (which is what happens currently).

I remember back with ActionScript 1 you could register a class (such as they were) with an exported library item using code rather than just using the library in the Flash IDE (as is the case now).

As far as I can tell you can’t do anything like that in AS3 - but maybe I’m wrong. Does anyone out there know some process to do this?

I think I’d prefer to do something like this rather than resort to composition but maybe that’s the only way forward…
