Flash 程式設計
很多Action Script的語法
Snippet Saturday: limit() function | dispatchEvent() Blog™
Snippet Saturday: limit() function
Posted on March 5, 2011 by Mims H WrightSo I’m sitting on a bunch of pretty useful code and I’m not sure how to share it with people. I could create a massive library that combines all the miscellaneous bits into a single, poorly documented library, but after looking at the Flash Game Dojo’s wiki, I’m starting to believe more strongly in the idea of releasing code in smaller pieces that achieve a particular function. So, I’m going to try to kick off this idea of #SnippetSaturday. I’m sure I won’t manage to post something every week but I’ll do my best. If you’ve got a blog or just twitter, I’d encourage you to join in too!
Anyway, here’s my first contribution. It’s a simple little function that limits a number between an upper and lower limit.