# Movieclip in embedded swf not centered

**URL:** <https://forum.kirupa.com/t/movieclip-in-embedded-swf-not-centered/318863>\
**Category:** Uncategorized\
**Created:** [February 2, 2011, 1:09am UTC](https://forum.kirupa.com/t/movieclip-in-embedded-swf-not-centered/318863 "2011-02-02T01:09:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![donbon](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@donbon](https://forum.kirupa.com/u/donbon)\
**Post date:** [February 2, 2011, 1:09am UTC](https://forum.kirupa.com/t/movieclip-in-embedded-swf-not-centered/318863/1 "2011-02-02T01:09:17Z")

</div>

I am having a problem trying to center a movieclip within an externally loaded swf.

To test, I placed one instance of the movieclip on the first frame of the timeline on child.swf and centered it and the other is displayed using actionscript. They both align perfectly when I test the swf.

The problem is that when I load this swf into another movie (parent.swf) they are no longer aligned with each other.

I used this code to align the movieclip in child.swf. It works fine when I  
open child.swf on it’s own but when I load child.swf into parent.swf the movieclips are not aligned.

```php

var logowrapMc:logowrap = new logowrap();
logowrapMc.x= stage.stageWidth / 2;
logowrapMc.y= stage.stageHeight / 2;
addChild (logowrapMc);

```

Here’s the code for parent.swf

```php
var swf:MovieClip;
var loader:Loader = new Loader();

// default swf
var defaultSWF:URLRequest = new URLRequest("swfs/child.swf");
loader.load(defaultSWF);

// position load SWF with variable, 480 x 300 are half the width/height of child swf 
loader.x = stage.stageWidth / 2 - 480;
loader.y = stage.stageHeight / 2 - 300;
    
// add default loaded swf
addChild(loader);

```

any help is most appreciated
