# Flash MX \_x, \_y question

**URL:** https://forum.kirupa.com/t/flash-mx--x--y-question/22574
**Category:** Uncategorized
**Created:** [June 5, 2003, 5:22pm UTC](https://forum.kirupa.com/t/flash-mx--x--y-question/22574 "2003-06-05T17:22:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![InnerPixel](https://avatars.discourse-cdn.com/v4/letter/i/848f3c/32.png) [@InnerPixel](https://forum.kirupa.com/u/InnerPixel)
#### Post date: [June 5, 2003, 5:22pm UTC](https://forum.kirupa.com/t/flash-mx--x--y-question/22574/1 "2003-06-05T17:22:54Z")

</div>

Basically what I want to do is load an external movie after an x and y value have been changed based on each buttons selection. Has anyone done this before?

[http://www.pinemerchants.com](http://www.pinemerchants.com)

For those of you who aren’t confused (lol) I’m having problems doing so.

Everytime I tried to get it to work it would just replace the main movie with whatever is being loaded no matter what level it was loaded onto (weird). Also, If I changed the level it would then take the loaded movie and apply the x and y of other buttons on it (stretching text etc).

Can anyone give me som insight to maye a better way of doing this?? :crazy:

---

<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: [June 5, 2003, 8:04pm UTC](https://forum.kirupa.com/t/flash-mx--x--y-question/22574/2 "2003-06-05T20:04:22Z")

</div>

Pretty helpful board.

---

<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: [June 5, 2003, 8:26pm UTC](https://forum.kirupa.com/t/flash-mx--x--y-question/22574/3 "2003-06-05T20:26:26Z")

</div>

_Duuuuuuh ?_ What do you mean ? Exactly ? Give us (ok me :P)an example, or a description how it should be

---

<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: [June 5, 2003, 8:29pm UTC](https://forum.kirupa.com/t/flash-mx--x--y-question/22574/4 "2003-06-05T20:29:46Z")

</div>

Yeah, I didn’t answer cause I didn’t get it. Do you not want that movieClip to move around when you hit buttons?

---

<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: [June 6, 2003, 2:08am UTC](https://forum.kirupa.com/t/flash-mx--x--y-question/22574/5 "2003-06-06T02:08:24Z")

</div>

Heh, Ok… I’ll try again cause it seems you guys aren’t quite getting it (sorry tough to explain lol).

the blue square in the middle has its x, y, height and width values changed based on what button is pressed at the top. That part is fine (as you can see from the site). The problem starts next.

What I want to do is have a movie load externally when you press “gallery” for example BUT only load once the box has reached it’s final destination (x, y, height, width).

Basically if the box is still moving I don’t want a movie to load.

The problem I’m facing is that it won’t allow me to load a movie in without it being controlled (oddly) by the same destination points (x, y, h, w)… It basically takes the text I have in a box and flash pretends it’s the main blue box… so when you click on different buttons it stretches and warps the text.

I will post my code below so you can get a better understanding of what I did. 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: [June 6, 2003, 2:15am UTC](https://forum.kirupa.com/t/flash-mx--x--y-question/22574/6 "2003-06-06T02:15:16Z")

</div>

Main timeline:

if (!first)  
{  
with (stage)  
{  
\_root.targetH = \_height;  
\_root.targetW = \_width;  
\_root.targetX = \_x;  
\_root.targetY = \_y;  
}  
first = true;  
\_root.loadFlag = true;  
\_root.movieName = “main.swf”;  
}

with (stage)  
{  
\_height += (\_root.targetH -\_height) /7;  
\_width += (\_root.targetW -\_width) /7;  
\_x += (\_root.targetX -\_x) /7;  
\_y += (\_root.targetY -\_y) /7;  
}

with (stage)  
{  
//trace(\_x+" “+\_y+” “+\_height+” "+\_width);  
if( Math.round(\_x) == \_root.targetX && Math.round(\_y) == \_root.targetY && Math.round(\_width) == \_root.targetW && Math.round(\_height) == \_root.targetH && !\_root.loadFlag)  
{  
with (\_root)  
{  
//loadMovie(\_root.movieName, 20);  
loadMovieNum(\_root.movieName, 20);  
}  
\_root.movieName = “”;  
\_root.loadFlag = true;  
}  
}

Button script:

on (press)  
{  
\_root.targetW = 480;  
\_root.targetH = 130;  
\_root.targetX = 10;  
\_root.targetY = 45;  
\_root.loadFlag = false;

}

on(release)  
{  
\_root.movieName = “gallery.swf”;  
//loadMovieNum (“gallery.swf”, 2);  
\_root.loadFlag = false;  
unloadMovieNum (20);  
}

---

<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: [June 6, 2003, 3:46am UTC](https://forum.kirupa.com/t/flash-mx--x--y-question/22574/7 "2003-06-06T03:46:46Z")

</div>

Well, If I understand you correctly, I would put in different emptyMovieClips as targets to load into. Then your external swf files will either conform to the original size of which it was made, or different parameters that you would set when calling in that swf. Does that work? Or do I still not get it?
