Run a peice of code once only no matter how many times you revisit the page

Seems like it’s dirty to me, but in AS3 you can’t just go !ranOnce so yea. If anyone knows a better way, I’m all ears!

var ranOnce:Boolean;
if(ranOnce != true) {
  setMenu();
  ranOnce = true;
}
Tech Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑