# A question about loading a movie into location?

**URL:** <https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169>\
**Category:** Uncategorized\
**Created:** [October 29, 2003, 4:25am UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169 "2003-10-29T04:25:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmattx](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xmattx](https://forum.kirupa.com/u/xmattx)\
**Post date:** [October 29, 2003, 4:25am UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/1 "2003-10-29T04:25:03Z")

</div>

when loading a movie into the main timeline is there a way to tell the movie to load into the center? instead of a set x,y postion? im sure its just a few extra lines of math… any help?

thanks!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2003, 7:46am UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/2 "2003-10-29T07:46:41Z")

</div>

It would be easier to just set it using x and y, but anyway. Let’s say you have a stage of w700 and h500:

```auto

mc.loadMovie("something.swf");
mc.onEnterFrame = function(){
if(this.getBytesLoaded() == this.getBytesTotal()){
this._x = 700-(this._width/2);
this._y = 500-(this._height/2);
delete this.onEnterFrame;
}
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2003, 11:46am UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/3 "2003-10-29T11:46:02Z")

</div>

it would be easier to use a simple x/y point, however what if you dont know the center of the movie, say when the swf is at 100%x100% in the browser… thats what I am trying to figure out how to do.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2003, 1:05pm UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/4 "2003-10-29T13:05:25Z")

</div>

I don’t think that’ll make a difference because when you set your animation to 100% you’ll be stretching it, not making it wider. I’ml not sure though, but why don’t you test it ? 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2003, 7:03pm UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/5 "2003-10-29T19:03:57Z")

</div>

not if the whole movie is not being stretched to 100% 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2003, 7:25pm UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/6 "2003-10-29T19:25:41Z")

</div>

assuming reg point is in center.

```auto

gizmo._x=(stage.width)/2;
gizmo._y=(stage.height)/2;

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2003, 7:31pm UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/7 "2003-10-29T19:31:44Z")

</div>

Montoya – No offense, but if you load an swf into a movieclip, won’t the registration point will be in the top-left ? Oh, and stage would be with a capital 🙂

Xmattx – Then don’t place it at 100% 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2003, 8:09pm UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/8 "2003-10-29T20:09:38Z")

</div>

Voets,

No offense taken… To clarify,

> when loading a movie into the main timeline is there a way to tell the movie to load into the center?

This was his request. And the answer satisfies that.

On the capitalization… the capitalization is required for MX2004, MX does not require it, although I agree it is a good practice.

You’re right about the loading of the swf. The swf that you are loading loads from the top/right. However, the empty movie clip or parent movie clip still has the registration in the center… (that was the assumption made above).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2003, 8:18pm UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/9 "2003-10-29T20:18:59Z")

</div>

Oh I see 🙂

About stage: you’re right, I always thought it had to be Stage … thanks for that, always learning 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2003, 8:34pm UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/10 "2003-10-29T20:34:28Z")

</div>

Me too 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 29, 2003, 9:02pm UTC](https://forum.kirupa.com/t/a-question-about-loading-a-movie-into-location/34169/11 "2003-10-29T21:02:08Z")

</div>

thanks 🙂
