# Constructors with Attached Movie Clip tied to class

**URL:** <https://forum.kirupa.com/t/constructors-with-attached-movie-clip-tied-to-class/313747>\
**Category:** flash\
**Created:** [September 8, 2010, 4:18pm UTC](https://forum.kirupa.com/t/constructors-with-attached-movie-clip-tied-to-class/313747 "2010-09-08T16:18:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunforce](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@arunforce](https://forum.kirupa.com/u/arunforce)\
**Post date:** [September 8, 2010, 4:18pm UTC](https://forum.kirupa.com/t/constructors-with-attached-movie-clip-tied-to-class/313747/1 "2010-09-08T16:18:07Z")

</div>

I have a movieclip, and it has export link “bob” and it links to the unit.as class file.

Inside unit.as

```auto

class unit extends MovieClip
{
        function unit(param1)
        {
               if (param1 == 1)
                     var mode = 1;
               else
                     var mode = 2;
        }
}

```

Now when I attach the MC, I want to call the constructor, and pass params… Is there anyway to do this? I always worked around it, but now I’m really curious if there is a way. :bandit:
