# Bug in with-statement?

**URL:** https://forum.kirupa.com/t/bug-in-with-statement/250871
**Category:** flash
**Created:** [February 2, 2008, 4:10pm UTC](https://forum.kirupa.com/t/bug-in-with-statement/250871 "2008-02-02T16:10:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cons](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@cons](https://forum.kirupa.com/u/cons)
#### Post date: [February 2, 2008, 4:10pm UTC](https://forum.kirupa.com/t/bug-in-with-statement/250871/1 "2008-02-02T16:10:25Z")

</div>

According to the docs, the scope chain used by the with statement to resolve identifiers is: innermost with-statement -\> outermost with-statement -\> activation object -\> etc. If this would be true, the following code should output “propOfMyObject”:

```auto
var foo:String = "propOfActivationObject";
var myObject:Object = {foo:"propOfMyObject"};
with (myObject) {
    trace(foo); //outputs: "propOfActivationObject"
}

```

But it doesn’t. Instead the local variable is shadowing the property in myObject. It seems like the scope chain rather is: activation object -\> innermost with-statement -\> outermost with-statement -\> etc. Which means either the docs or the with statement is falsy. Am I right?
