# Problems with unloadMovie!

**URL:** <https://forum.kirupa.com/t/problems-with-unloadmovie/195652>\
**Category:** Uncategorized\
**Created:** [August 2, 2006, 6:17am UTC](https://forum.kirupa.com/t/problems-with-unloadmovie/195652 "2006-08-02T06:17:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![foxandsoul](https://avatars.discourse-cdn.com/v4/letter/f/0ea827/32.png) [@foxandsoul](https://forum.kirupa.com/u/foxandsoul)\
**Post date:** [August 2, 2006, 6:17am UTC](https://forum.kirupa.com/t/problems-with-unloadmovie/195652/1 "2006-08-02T06:17:27Z")

</div>

[SIZE=3][FONT=Times New Roman] I have two buttons: Home and Portfolio. Portfolio contains another two buttons First and Second. Buttons First and Second have about the same code:[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]on (release) {[/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman] this.createEmptyMovieClip(“empty”,99)[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3]on (release) {[/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman] if (\_root.intro.\_currentframe\<=37) {[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_root.empty.gotoAndPlay(2);[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]on (release) {[/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman] if (\_root.intro.\_currentframe\>=39) {[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_root.empty.loadMovie(“external.swf”);[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]where intro is the other movie clip.[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]If I just start my main.swf and first press First or Second buttons everything works very good. But after I press Home my external files start to play just on the second press of the button First ( or Second). Second press of any button corresponds I guess with: [/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3]on (release) {[/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman] if (\_root.intro.\_currentframe\>=39) {[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] \_root.empty.loadMovie(“external.swf”);[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]The Home button has the following code:[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]on(release){[/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman] \_root.empty.unloadMovie("");[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]I guess this code erases the external movie from my empty movie clip and it doesn’t start playing until it meats \_root.empty.loadMovie(“external.swf”).[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]The empty movie clip has stop() on the first frame and the following code on the frame 42:[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]onEnterFrame(42);{[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]\_root.empty.loadMovie(“landmarks.swf”)[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]stop();[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]I did it because sometimes I need 42 frames delay for the external movie to start. That is why I have \_root.empty.gotoAndPlay(2).[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]The question is what can I do so that unloadMovie code doesn’t effect that way to the performance of the movie?[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
