# 2 q's

**URL:** <https://forum.kirupa.com/t/2-qs/1728>\
**Category:** flash\
**Created:** [June 3, 2002, 11:21pm UTC](https://forum.kirupa.com/t/2-qs/1728 "2002-06-03T23:21:44Z")\
**Posts on this page:** 9\
**Page:** 1

<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 3, 2002, 11:21pm UTC](https://forum.kirupa.com/t/2-qs/1728/1 "2002-06-03T23:21:44Z")

</div>

# 1)I’ve created a button to load a movie on click

# but1.onPress = function() { \_root.createEmptyMovieClip(“container”, 1); loadMovie(“movie1.swf”, “container”); container.\_x = 100; container.\_y = 100; };

but i would like to have an “x” in the corner of the loaded movie to “unload” the movie…where/what code would i need?

2)Also the root movie that the seperate movies are being loaded into is 800x600 and i would like, on HTML button click that the flash would load in a non-resizable 800x600 window. Hope you gurus can help, TIA

¨l JuiceTheRide ¨l

---

<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 4, 2002, 12:05am UTC](https://forum.kirupa.com/t/2-qs/1728/2 "2002-06-04T00:05:51Z")

</div>

1)…  
\_root.container.createEmptyMovieClip(“remove”,1);  
\_root.container.remove.lineStyle(2,0xff0000,100);  
\_root.container.remove.beginFill(0x00ff00,100);  
\_root.container.remove.moveTo(0,0);  
\_root.container.remove.lineTo(20,0);  
\_root.container.remove.lineTo(20,20);  
\_root.container.remove.lineTo(0,20);  
\_root.container.remove.endFill();  
\_root.container.remove.moveTo(5,5);  
\_root.container.remove.lineTo(15,15);  
\_root.container.remove.moveTo(15,5);  
\_root.container.remove.lineTo(5,15);  
\_root.container.remove.onRelease = function (){  
removeMovieClip(\_root.container);  
};

1. there’s a tutorial here on kirupa that shows you how to open up a window like that. if that doesn’t work try [www.flashkit.com](http://www.flashkit.com).

🙂  
jeremy

---

<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 4, 2002, 2:12am UTC](https://forum.kirupa.com/t/2-qs/1728/3 "2002-06-04T02:12:53Z")

</div>

Sinf…I tried that code, and it loaded the SWF and everything, but it didn’t create any lines or anything…

but1.onPress = function() {  
\_root.createEmptyMovieClip(“container”, 1);  
loadMovie(“[http://www10.brinkster.com/jubbaorf/dragonFly.swf](http://www10.brinkster.com/jubbaorf/dragonFly.swf)”, “container”);  
container.\_x = 100;  
container.\_y = 100;  
\_root.container.createEmptyMovieClip(“remove”,1);  
\_root.container.remove.lineStyle(2,0xff0000,100);  
\_root.container.remove.beginFill(0x00ff00,100);  
\_root.container.remove.moveTo(0,0);  
\_root.container.remove.lineTo(20,0);  
\_root.container.remove.lineTo(20,20);  
\_root.container.remove.lineTo(0,20);  
\_root.container.remove.endFill();  
\_root.container.remove.moveTo(5,5);  
\_root.container.remove.lineTo(15,15);  
\_root.container.remove.moveTo(15,5);  
\_root.container.remove.lineTo(5,15);  
\_root.container.remove.onRelease = function (){  
removeMovieClip(\_root.container);  
};  
}

am I missing something? I’m just trying to figure out this new MX stuff…

---

<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 4, 2002, 4:42am UTC](https://forum.kirupa.com/t/2-qs/1728/4 "2002-06-04T04:42:50Z")

</div>

that’s weird…it worked by itself. try this:

but1.onPress = function() {  
\_root.createEmptyMovieClip(“container”, 1);  
\_root.container.loadMovie(“[http://www10.brinkster.com/jubbaorf/dragonFly.swf](http://www10.brinkster.com/jubbaorf/dragonFly.swf)”);  
\_root.container.\_x = 100;  
\_root.container.\_y = 100;  
\_root.createEmptyMovieClip(“remove”,2);  
\_root.remove.\_x = 100;  
\_root.remove.\_y = 100;  
\_root.remove.lineStyle(2,0xff0000,100);  
\_root.remove.beginFill(0x00ff00,100);  
\_root.remove.moveTo(0,0);  
\_root.remove.lineTo(20,0);  
\_root.remove.lineTo(20,20);  
\_root.remove.lineTo(0,20);  
\_root.remove.endFill();  
\_root.remove.moveTo(5,5);  
\_root.remove.lineTo(15,15);  
\_root.remove.moveTo(15,5);  
\_root.remove.lineTo(5,15);  
\_root.remove.onRelease = function (){  
removeMovieClip(\_root.container);  
this.removeMovieClip();  
};  
}

i tried it on my box and it worked (i also dynamically created the button ‘but1’.).  
jeremy

---

<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 4, 2002, 3:16pm UTC](https://forum.kirupa.com/t/2-qs/1728/5 "2002-06-04T15:16:00Z")

</div>

that worked…so what was changed? I still can’t get the hang of this lineTo/moveTo crap…

---

<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 4, 2002, 3:34pm UTC](https://forum.kirupa.com/t/2-qs/1728/6 "2002-06-04T15:34:43Z")

</div>

basically i took the ‘remove’ clip out of the ‘container’ clip. sometimes with loaded movies you can’t apply actions to the loaded clip until it’s loaded.  
🙂  
jeremy

---

<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 4, 2002, 4:35pm UTC](https://forum.kirupa.com/t/2-qs/1728/7 "2002-06-04T16:35:50Z")

</div>

i see. I understand now. thanks sinf.

one question…how did you dynamically create a button?

---

<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 4, 2002, 9:08pm UTC](https://forum.kirupa.com/t/2-qs/1728/8 "2002-06-04T21:08:42Z")

</div>

when you give a movie clip an ‘onRelease’ event it is treated like a button. play around with it a little (the button events on mc’s) and you will be very please with this. it’s the best thing since the Math object!  
🙂  
jeremy

---

<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 4, 2002, 9:11pm UTC](https://forum.kirupa.com/t/2-qs/1728/9 "2002-06-04T21:11:51Z")

</div>

all right kool. thanks sinf
