# Using a class in a class

**URL:** <https://forum.kirupa.com/t/using-a-class-in-a-class/261826>\
**Category:** Uncategorized\
**Created:** [May 31, 2008, 11:22am UTC](https://forum.kirupa.com/t/using-a-class-in-a-class/261826 "2008-05-31T11:22:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [May 31, 2008, 11:22am UTC](https://forum.kirupa.com/t/using-a-class-in-a-class/261826/1 "2008-05-31T11:22:37Z")

</div>

Hi there …

How would I import a class (such as a tween engine) in to my custom class?

Or How can I allow my custom class to use the imported class which is ‘included’ in the main swf file…?

…//////////////////////////////////  
First of all get the AS 2.0 version of that class.  
Then simply use the import statement inside your custom class.

```
ActionScript Code:
[LEFT][COLOR=#0000FF]import[/COLOR] mc_tween_as2

```

[COLOR=#000000] **class** [/COLOR] YourCustomClass [COLOR=#0000FF]extends[/COLOR] [COLOR=#0000FF]MovieClip[/COLOR][COLOR=#000000]{ [/COLOR]  
[COLOR=#808080]_//…_[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[/LEFT]

```
	.......................&gt;&gt; I was advised.

```

But if my tween engine, included in the root SWF is ‘MC\_tween.as’ - how would I write it?
