# FMX - Problem whit loading image to MC

**URL:** https://forum.kirupa.com/t/fmx-problem-whit-loading-image-to-mc/21358
**Category:** flash
**Created:** [May 20, 2003, 9:18pm UTC](https://forum.kirupa.com/t/fmx-problem-whit-loading-image-to-mc/21358 "2003-05-20T21:18:28Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jagunco](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@jagunco](https://forum.kirupa.com/u/jagunco)
#### Post date: [May 20, 2003, 9:18pm UTC](https://forum.kirupa.com/t/fmx-problem-whit-loading-image-to-mc/21358/1 "2003-05-20T21:18:28Z")

</div>

Can someone take a look at my code, what i was trying to do is to have a picture loadind to inside or upside the MC that streches, the fla included as an attach MC, but I can´t find a way to find the center of the strehed MC

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: [May 21, 2003, 4:32am UTC](https://forum.kirupa.com/t/fmx-problem-whit-loading-image-to-mc/21358/2 "2003-05-21T04:32:06Z")

</div>

the center is still 0,0

but since the proportions of the container clip are altered all your content will be squished too. If the container starts a square, it needs to stay a square or any movies loaded _into_ it will be stretched funny. Have the content attach on the main timeline instead of into the clip, and have it position it over the stretched clip.  
OLD -\>  
\_root.mc01.content\_mc.attachMovie(“movie01”,“movie022”,10)  
NEW -\>  
\_root.attachMovie(“movie01”,“movie022”,10,{\_x:\_root.mc01.\_x,\_y:\_root.mc01.\_y})

this last part between the {} can give the clip properties before it is attached. I am setting its \_x and \_y properties to be the same as that of the stretched clip (mc01), which will center it over it, as long as you make sure the content is centered around 0,0 in its swf. Other wise you would want to use this:

{\_x:\_root.mc01.\_x - \<the width of the swf\>,  
\_y:\_root.mc01.\_y - \<the height of the swf\>}

A better option would be to place both mc01 and the attachedMovie inside a container clip  
_that does not get stretched._ Stretch mc01 inside it and then say \_root.containerClip.attachMovie(…

If I say anything confusing just ask me to explain better.

---

<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: [May 21, 2003, 9:46am UTC](https://forum.kirupa.com/t/fmx-problem-whit-loading-image-to-mc/21358/3 "2003-05-21T09:46:25Z")

</div>

I understand the first part, but I did not the second part were you say " a better option is".

Another question , if you don´t mind is, the objective for this is to have load movie and not attach movie clip, but when i change to load movie , the loaded swf erases the mc that streches, and is loaded to the center of the mc.

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: [May 21, 2003, 1:31pm UTC](https://forum.kirupa.com/t/fmx-problem-whit-loading-image-to-mc/21358/4 "2003-05-21T13:31:58Z")

</div>

loadMovie works a little differently from attachMovie. For the type of thing you are doing loadMovie is probably the way to go.

When you use attachMovie, you have to specify a MovieClip to be the new clip’s parent, when you use loadMovie you have to specify a clip to \* be replaced by\* the loaded clip. So what you can do is to have an empty clip waiting to be replaced. If this clip is named content\_mc, then when your movie is loaded, you can refer to it by the name content\_mc, and it will have all the properties that content\_mc had when it was replaced.

The main point of the second thing I was saying was that you can use a clip within a clip just to organize your symbols.

Draw a square and convert it to a symbol. Then create a new symbol with nothing in it and drag it on top of the square. Name the square stretch\_mc and the emptyclip content\_mc, then select them both and convert to symbol. Name it contentframe\_mc. Now your clip structure is organized like this:

\>contentframe\_mc  
-\>stretch\_mc  
-\>content\_mc

When you apply the stretching script to contentframe\_mc.stretch\_mc, contentframe\_mc.content\_mc will be unaffected stretchwise, and when you loadMovie into contentframe\_mc.content\_mc (which is empty) it will be “over” the stretched rectangle, but it will not wipe it out.

Then on your main stage you have just one clip contentframe\_mc which you can duplicate to contentframe2\_mc etc, and each content\_mc inside will still be centered in the stretch\_mc that belongs to 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: [May 21, 2003, 2:23pm UTC](https://forum.kirupa.com/t/fmx-problem-whit-loading-image-to-mc/21358/5 "2003-05-21T14:23:17Z")

</div>

it worked, is this what I really wanted, is not new but i think this as some potencial.

Thanks for helping me out,

i live in portugal and i started to work whit flash 1 year and 6 months ago, I take 1 course, but here the courses in flash are so elementar, what book do you think is better, not to begginers.

thsnks a lot

fausto

---

<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: [May 21, 2003, 2:41pm UTC](https://forum.kirupa.com/t/fmx-problem-whit-loading-image-to-mc/21358/6 "2003-05-21T14:41:46Z")

</div>

i have using flash MX by Michael Hurwicz and i find it very helpful and not too elementary. I knew javascript a little before I got the book though, so I was able to get through a lot of it pretty quickly.

---

<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: [May 21, 2003, 2:42pm UTC](https://forum.kirupa.com/t/fmx-problem-whit-loading-image-to-mc/21358/7 "2003-05-21T14:42:42Z")

</div>

kirupa has some good ones too  
[http://www.kirupa.com/store/flashbooks.asp](http://www.kirupa.com/store/flashbooks.asp)
