# Help with x and y positions and layering for external swf

**URL:** <https://forum.kirupa.com/t/help-with-x-and-y-positions-and-layering-for-external-swf/261677>\
**Category:** flash\
**Created:** [May 29, 2008, 7:25pm UTC](https://forum.kirupa.com/t/help-with-x-and-y-positions-and-layering-for-external-swf/261677 "2008-05-29T19:25:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![red5\_ws](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@red5\_ws](https://forum.kirupa.com/u/red5_ws)\
**Post date:** [May 29, 2008, 7:25pm UTC](https://forum.kirupa.com/t/help-with-x-and-y-positions-and-layering-for-external-swf/261677/1 "2008-05-29T19:25:49Z")

</div>

Could someone please provide the actionscript for when you are loading an external swf to set it at a certain x/y location and also how to bring it to the top. Thanks.

---

<div class="post-metadata">

**Author:** ![pandu\_kirupa](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@pandu\_kirupa](https://forum.kirupa.com/u/pandu_kirupa)\
**Post date:** [May 30, 2008, 6:56am UTC](https://forum.kirupa.com/t/help-with-x-and-y-positions-and-layering-for-external-swf/261677/2 "2008-05-30T06:56:57Z")

</div>

Hi,

```
 create a empty movieclip and use the MovieClipLoader class to set the x/y positions. 

 below is the sample code: 

```

```php

createEmptyMovieClip("holder_mc", _root.getNextHighestDepth());
var mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadInit = function(mc:MovieClip) {
    mc._x = 200; // Set your X position here.
    mc._y = 200; // Set your Y position here.
};
mcl.addListener(mclListener);
mcl.loadClip("your.swf", holder_mc);
   

```

---

<div class="post-metadata">

**Author:** ![red5\_ws](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@red5\_ws](https://forum.kirupa.com/u/red5_ws)\
**Post date:** [May 30, 2008, 2:45pm UTC](https://forum.kirupa.com/t/help-with-x-and-y-positions-and-layering-for-external-swf/261677/3 "2008-05-30T14:45:37Z")

</div>

:party:[quote=pandu\_kirupa;2333470]Hi,

create a empty movieclip and use the MovieClipLoader class to set the x/y positions.

below is the sample code:

```php

createEmptyMovieClip("holder_mc", _root.getNextHighestDepth());
var mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadInit = function(mc:MovieClip) {
    mc._x = 200; // Set your X position here.
    mc._y = 200; // Set your Y position here.
};
mcl.addListener(mclListener);
mcl.loadClip("your.swf", holder_mc);
   

```

[/quote]
