system
June 3, 2002, 11:21pm
1
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
system
June 4, 2002, 12:05am
2
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);
};
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 .
jeremy
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 ”, “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…
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 ”);
_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
that worked…so what was changed? I still can’t get the hang of this lineTo/moveTo crap…
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
i see. I understand now. thanks sinf.
one question…how did you dynamically create a button?
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
all right kool. thanks sinf