# With(mc){...} Problem

**URL:** <https://forum.kirupa.com/t/with-mc-problem/229107>\
**Category:** Uncategorized\
**Created:** [June 14, 2007, 6:41am UTC](https://forum.kirupa.com/t/with-mc-problem/229107 "2007-06-14T06:41:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![7788](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/7788/32/2860_2.png) [@7788](https://forum.kirupa.com/u/7788)\
**Post date:** [June 14, 2007, 6:41am UTC](https://forum.kirupa.com/t/with-mc-problem/229107/1 "2007-06-14T06:41:09Z")

</div>

```auto

_root.createEmptyMovieClip("mc",1)

with(mc){
myVar = "Hello" //I want this as mc.myVar but its _root.myVar
_x = 10
}

trace(mc.myVar) //undefined
trace(mc._x) //10

```

How can I set variables for ‘mc’ using with(){…} and why does it work for properties but not variables?  
Do I have to use mc.myVar = … every time?  
Thanks in advance!
