# onRollOver to trigger only once?

**URL:** <https://forum.kirupa.com/t/onrollover-to-trigger-only-once/209574>\
**Category:** flash\
**Created:** [December 10, 2006, 12:54pm UTC](https://forum.kirupa.com/t/onrollover-to-trigger-only-once/209574 "2006-12-10T12:54:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chorug](https://avatars.discourse-cdn.com/v4/letter/c/ea5d25/32.png) [@Chorug](https://forum.kirupa.com/u/Chorug)\
**Post date:** [December 10, 2006, 12:54pm UTC](https://forum.kirupa.com/t/onrollover-to-trigger-only-once/209574/1 "2006-12-10T12:54:57Z")

</div>

Hi!

I’m a newbie to Flash and AS and I have tried Google and these forums for answer but I still haven’t grasped it.

Here goes: I’m loading a button in an onRollOver event. It’s a link with an extra option. The thing is I only want it to load only once and stay put and not repeat every time the mouse rolls over (again). I have tried with different conditions but it doesn’t work. I want it to happen in ONE frame only. Any ideas greatly appreciated. One of my failed tries below:

var rolledOver:Boolean = false;  
my\_btn.onRollOver = function() {  
if (!rolledOver) {  
frame.attachMovie(“btn\_link1”, “test”, this.getNextHighestDepth);  
var rolledOver:Boolean = true;  
}

Thanx in advance.  
/Chorug
