# Onclipevent and if statements

**URL:** <https://forum.kirupa.com/t/onclipevent-and-if-statements/197107>\
**Category:** Uncategorized\
**Created:** [August 13, 2006, 11:31pm UTC](https://forum.kirupa.com/t/onclipevent-and-if-statements/197107 "2006-08-13T23:31:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chevron8653](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@chevron8653](https://forum.kirupa.com/u/chevron8653)\
**Post date:** [August 13, 2006, 11:31pm UTC](https://forum.kirupa.com/t/onclipevent-and-if-statements/197107/1 "2006-08-13T23:31:26Z")

</div>

hey guys well i have a movie clip title g\_mc and i have this folowing code on the movie clip with an onclip event

onClipEvent (keyDown) {  
if ( Key.getAscii() == 97 && g\_mc.\_alpha == 100 && \_global.Isg == 0 )  
\_root.g\_mc.gotoAndPlay("\_engaging")  
}

what im wanting is that when the user press a when the movie clip alpha level is 100 and on the frame that the global Isg is set to 0 to play the engaging animation but no variation of this code works.  
also when i global variable in g\_mc is greater then zero and they press a again i dont want it to do nething and i only want it too work if as i said the \_alpha level of g\_mc is 100.

thanks hope u can understand that thanks in advanced ne ways
