-------simpele version------------------------------------------------ function CloseIt() { fscommand("ebAutoClose", ""); trace("close"); } CloseItID = setInterval(CloseIt, 8000); -------extended version------------------------------------------------ //Below version stops the internval and starts it again on mouse out, copy the code below and insert it into the 2nd keyframe. // create a button instance and call it "myButton" // Mc's & vars: var myButton:MovieClip; // button instance on stage. var ebCloseItID; // interval object. var ebTimeToClose = 8000; // amount of miliseconds the ad should close. // Function to start the close interval; function ebStartAutoClose():Void { ebCloseItID = setInterval(ebCloseIt, _root.ebTimeToClose); } // Function to stop the ad from closing. function ebStopAutoClose():Void { clearInterval(_root.ebCloseItID); } // Close interval function: function ebCloseIt():Void { fscommand("ebAutoClose", ""); clearInterval(_root.ebCloseItID); trace("ebAutoClose"); } // Button functions: myButton.onRollOver = myButton.onDragOver = function () { _root.ebStopAutoClose(); }; myButton.onRollOut = myButton.onDragOut = function () { _root.ebStartAutoClose(); }; myButton.onRelease = function() { _root.ebStopAutoClose(); fscommand("ebInteraction", ""); trace("ebInteraction"); };