# Issues with with() block

**URL:** https://forum.kirupa.com/t/issues-with-with-block/120517
**Category:** Uncategorized
**Created:** [August 25, 2004, 2:53am UTC](https://forum.kirupa.com/t/issues-with-with-block/120517 "2004-08-25T02:53:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![GW02](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GW02](https://forum.kirupa.com/u/GW02)
#### Post date: [August 25, 2004, 2:53am UTC](https://forum.kirupa.com/t/issues-with-with-block/120517/1 "2004-08-25T02:53:27Z")

</div>

In the code I’m writing, I use a with block to reference a newly created object thus:

```auto
with ( ArrowL.duplicateMovieClip ( "ArrowL" + i , -500 + i , ArrowL ) )

```

The with command works great, and I set its \_x, its \_y and stuff. Then I parse an XML object and put the result into a variable (still in the with block). The variable (xot), however, isn’t registering as part of the newly created object, but instead settles down under \_root!

I tried doing this.xot, xot, and other stuff, but it just keeps sliding under \_root.xot instead of ArrowL##.xot.

Heeeelp?

Thanks!

---

<div class="post-metadata">

### Author: ![RvGaTe](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rvgate/32/126_2.png) [@RvGaTe](https://forum.kirupa.com/u/RvGaTe)
#### Post date: [August 25, 2004, 5:10am UTC](https://forum.kirupa.com/t/issues-with-with-block/120517/2 "2004-08-25T05:10:15Z")

</div>

try this instead:

Object = ArrowL.duplicateMovieClip(parameters, blablablablabla);  
Object.xot = new XML();  
Object.xot.load(“xml file”);  
Object.\_x = 0; // whatever  
Object.\_y = 0; // whatever

works better then the With stuff… but if you really want to use the With:

With(object){  
this.xot = new XML();  
this.xot.load(“xmlfile”);  
}

---

<div class="post-metadata">

### Author: ![GW02](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GW02](https://forum.kirupa.com/u/GW02)
#### Post date: [August 25, 2004, 9:25pm UTC](https://forum.kirupa.com/t/issues-with-with-block/120517/3 "2004-08-25T21:25:23Z")

</div>

> [@RvGaTe](#):
>
> With(object){  
> this.xot = new XML();  
> this.xot.load(“xmlfile”);  
> }

Yeah, that’s exactly my problem… when I write the above code, it doesn’t create the xot XML data under object, instead it creates it under \_root.

It would be very difficult at this stage to change the with tags, so do you have any other suggestions? Thanks.
