Skip to content

Instantly share code, notes, and snippets.

@hushin
Created May 6, 2012 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hushin/2622518 to your computer and use it in GitHub Desktop.
Save hushin/2622518 to your computer and use it in GitHub Desktop.
Flash Timeline で FizzBuzz
// --------------------------------------------------------------------------------
// Timeline で FizzBuzz
xjsfl.init(this);
var context = Context.create();
clear();
//trace(context);
//inspect(context.timeline);
for (var i = 0; i < 100; i++) {
context.timeline.insertKeyframe(i);
var keyframe = context.keyframes[i];
var n = i + 1;
if (n % 15 == 0) {
keyframe.name = 'FizzBuzz';
} else if (n % 3 == 0) {
keyframe.name = 'Fizz';
} else if (n % 5 == 0) {
keyframe.name = 'Buzz';
} else {
keyframe.name = n;
}
trace(i, 'keyfame.name :', keyframe.name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment