# Strict typing | Type Mismatch - But Why?

**URL:** <https://forum.kirupa.com/t/strict-typing-type-mismatch-but-why/166419>\
**Category:** flash\
**Created:** [October 19, 2005, 7:22pm UTC](https://forum.kirupa.com/t/strict-typing-type-mismatch-but-why/166419 "2005-10-19T19:22:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashead](https://avatars.discourse-cdn.com/v4/letter/f/46a35a/32.png) [@flashead](https://forum.kirupa.com/u/flashead)\
**Post date:** [October 19, 2005, 7:22pm UTC](https://forum.kirupa.com/t/strict-typing-type-mismatch-but-why/166419/1 "2005-10-19T19:22:09Z")

</div>

```auto
function myFunction():Void {
 var myMC:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
 var myTxt:TextField = myMC.createTextField("txt", 0, 20, 20, 0, 0);
}

```

The above function returns the error below:

> Type mismatch in assignment statement: found Void where TextField is required.

But I don’t understand why.

As far as a work-around, I can just reference the ‘mc’ movieclip by its actual instance name, that wont be a problem as of yet. but if there was a situation where i wanted to reference the movieclip by this ‘myMC’ variable, like i’m attempting to above, how would it be done?

thanks for any help in advance.
