# Making sure a movie clip always finishes

**URL:** https://forum.kirupa.com/t/making-sure-a-movie-clip-always-finishes/275599
**Category:** flash
**Created:** [November 16, 2008, 6:22pm UTC](https://forum.kirupa.com/t/making-sure-a-movie-clip-always-finishes/275599 "2008-11-16T18:22:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![oddballs24](https://avatars.discourse-cdn.com/v4/letter/o/b77776/32.png) [@oddballs24](https://forum.kirupa.com/u/oddballs24)
#### Post date: [November 16, 2008, 6:22pm UTC](https://forum.kirupa.com/t/making-sure-a-movie-clip-always-finishes/275599/1 "2008-11-16T18:22:48Z")

</div>

Hi,

I am trying to create an animation where if the user hovers over a movie clip, its ‘over’ frames are called, and when the user moves his/her mouse away, its ‘out’ frames are called. Finally, if the movie clip is clicked, a line draw function would be called. Basically, when I hover over ‘England’ (a movie clip), other movie clips play a certain sequence. All the movie clips are identical (apart from the name).

This is what I have at the moment (I havent added the click functionality yet):

E n g l a n d . b u t t o n M o d e = t r u e ;  
E n g l a n d . a d d E v e n t L i s t e n e r ( M o u s e E v e n t . R O L L \_ O V E R , E n g l a n d O v e r H a n d l e r ) ;  
E n g l a n d . a d d E v e n t L i s t e n e r ( M o u s e E v e n t . R O L L \_ O U T , E n g l a n d O u t H a n d l e r ) ;

f u n c t i o n E n g l a n d O v e r H a n d l e r ( e v e n t : M o u s e E v e n t ) {  
e v e n t . t a r g e t . g o t o A n d P l a y ( " o v e r " ) ;  
A m e r i c a . g o t o A n d P l a y ( " i n d i r e c t o v e r " ) ;  
H o l l a n d . g o t o A n d P l a y ( " i n d i r e c t o v e r " ) ;  
B r a z i l . g o t o A n d P l a y ( " i n d i r e c t o v e r " ) ;  
F r a n c e . g o t o A n d P l a y ( " i n d i r e c t o v e r " ) ;  
G e r m a n y . g o t o A n d P l a y ( " i n d i r e c t o v e r " ) ;  
S o u t h A f r i c a . g o t o A n d P l a y ( " i n d i r e c t o v e r " ) ;  
S i n g a p o r e . g o t o A n d P l a y ( " i n d i r e c t o v e r " ) ;  
}

f u n c t i o n E n g l a n d O u t H a n d l e r ( e v e n t : M o u s e E v e n t ) {  
e v e n t . t a r g e t . g o t o A n d P l a y ( " o u t " ) ;  
A m e r i c a . g o t o A n d P l a y ( " i n d i r e c t o u t " ) ;  
H o l l a n d . g o t o A n d P l a y ( " i n d i r e c t o u t " ) ;  
B r a z i l . g o t o A n d P l a y ( " i n d i r e c t o u t " ) ;  
F r a n c e . g o t o A n d P l a y ( " i n d i r e c t o u t " ) ;  
G e r m a n y . g o t o A n d P l a y ( " i n d i r e c t o u t " ) ;  
S o u t h A f r i c a . g o t o A n d P l a y ( " i n d i r e c t o u t " ) ;  
S i n g a p o r e . g o t o A n d P l a y ( " i n d i r e c t o u t " ) ;  
}  
This is repeated for each country, and each one affects a different list of others.

The problem is that at the moment when the user moves his/her mouse away the ‘over’ frames don’t get a chance to finish before the ‘out’ starts, and the same will happen when the clip is clicked. I think I may need to use ‘enterFrame’ but i’m not sure how. Any help would be much appreciated.

Thanks in advance!
