# Help with AS

**URL:** <https://forum.kirupa.com/t/help-with-as/69883>\
**Category:** flash\
**Created:** [November 8, 2004, 11:24pm UTC](https://forum.kirupa.com/t/help-with-as/69883 "2004-11-08T23:24:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohadeb](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mohadeb](https://forum.kirupa.com/u/Mohadeb)\
**Post date:** [November 8, 2004, 11:24pm UTC](https://forum.kirupa.com/t/help-with-as/69883/1 "2004-11-08T23:24:53Z")

</div>

on (rollOver) {  
gotoAndPlay(“On”);  
}

onRelease = function() {  
if (\_root.section != “maskad4.swf”) {  
\_root.section = “maskad4.swf”;  
\_root.transition.gotoAndPlay(“closing”);  
}  
};  
on (rollOut) {  
gotoAndPlay(“Out”);  
}

I need to write this function correctly but can’t seem to get it to work.

This is a button and on the rollover it play part of the movie. If the click the button it does an onload and a new .swf is loaded into the open movie. If they rollout of the button plays a different part of the movie.

Basically if they rollover the button it highlights. If the click the button it loads a movie. If the rollout of the button it does a rollout effect.

Thanks for the help.
