home page icon Flash Bestiary

A collection of some of Jim's posts on FlashKit.com, on various Flash actionscript-related topics.

Animating with Actionscript

Good Actionscript Books that cover animation

Getting smoother tweens.

Drawing Circles and Arcs

Making text revolve around a sphere (like Universal Logo)

Get text to slide with a bouncy/elastic motion.

Get a moving object to point (rotate) in the direction it is moving.

Getting a movieclip to stay on the stage.

Getting a movieclip to bounce off walls or stay within a boundary.

Getting circles to stay within a circle.

As you drag an object, a line connects it to another object,

User draws mask, revealing layer underneath

Clip2 continually repositions itself with respect to Clip1

Bubbles/Hearts floating upward

Horizontal flying leaves via attachMovie

Animated spinning CD with acceleration.

Animated recycle sign - animating _rotation.

Animating a 5-point star kaleidoscopic pattern

Imitating a cool effect #1

Imitating a cool effect #2

Help - animating using a loop doesn't work!

Do you like the Bestiary? Want to see more free actionscript source code from Jim? Then make a donation! Thank you!!

Game Programming

Make character walk in direction of mouse.

Making the computer move a car randomly.

Collision Testing 101

Restricting motion of character controlled by arrow keys.

Making a Maze game from a scanned drawing.

Colliding with the walls of a maze

Arkanoid Game - Ball/Paddle alignment problems

Shuffling cards

Create a random trajectory for a ball using sin/cos.

Making a hangman game.

Multiple choice quiz, XML

Player AI - how to do it?

Why general-purpose physics engines may be a waste of time.

Making GUIs

How to respond to any key.

On any key, go to the next frame

Implementing a dragbar widget that is attached to another clip.

Radar map which is a small scale version of larger movie & contains object controlled by mouse.

Bring layer to front on rollover, moving object on rollover.

Small object within larger object that both respond to rollovers (rollover within rollover)

Moving a film strip back and forth with mouse.

Auto-scrolling map with zoom on landmarks.

Child movie retains original size, even though parent movie is stretched (scroll bar thumb)

Dynamically create rows & columns of buttons.

Making a two-state toggle button (in one line).

An Array and lots of buttons to go with it.

Controlling Playback or Code Execution

Make a movieclip start when another movieclip ends.

Controlling playback backwards and forward with mouse

Use random number to choose a frame number.

How to run a function after so many seconds.

How do I get actionscript to wait, and then execute some more code?

Playing tones with 100 ms interval doesn't work from loop

Playing different video clips in response to user text

Change frames randomly every four seconds

Repeat a section of animation 3 times, then continue.

Pause for 10 seconds, then continue, via setInterval

Moving wave animation via sin wave or spring physics.

Interpolate (tween) from one color to another.

Checking for two properties in an 'if' statement.

Display text and pause longer or shorter depending on length of text.

Breaking out of multiple embedded loops simultaneously.

Understanding the difference between a for-loop and a while-loop


Duplicate or Attach?

loadMovie versus attachMovie - making a dynamic gallery

Arranging clips in a grid with duplicateMovieClip or attachMovie

Some scripts stop working when I load movie via attachMovie - works okay standalone.

Duplicating movieclips doesn't work all the time (depth problem)

A better way to get a bunch of movieclips to unload.

About getNextHighestDepth() and attachMovie()

Setting _x and _y after LoadMovie doesn't work. How come and how to fix it?

How to make a group of attached movies know their own names or numbers.

LoadMovie isn't working


Preloader mathematics

When making preloaders, ratios are your friend.

My preloader isn't working.

LoadVars, XML, Passing Vars to flash

Is XML the only way to pass data to flash?

How come the stuff I loaded is undefined?

Passing variables to Flash movie from HTML

Loading into an array from LoadVars

Parsing XML

Talking/posting to a CGI form.

Multiple choice quiz, XML

Actionscript from XML - is it possible?

String/Text Processing

Remove $ and , from numbers.

Random upper/lower case

Add a new line to a text field.

Keeping dynamic textfields centered.

Find line breaks in text field.

Censoring foul language from strings.

Count number of lines in a textbox.

Understanding & Optimizing Code

Why aren't other languages more like actionscript?

What is 'this' and '_parent'?

Understanding the different names of a button.

More on understanding naming.

Understanding character movement and collision code

Understanding the difference between a for-loop and a while-loop.

General tips on reducing CPU Suckage

Help me optimize my code (functions, arrays and loops).

How to optimize code that is handling multiple buttons.

Should I use conditionals to save the processor?

Shorten my longwinded code (a jillion buttons, all the same)

Different ways of coming up with dynamic variable names.

Storing movieclip identifiers in an array. Look Ma! No Strings!

Best way to store a list of x/y coordinates in an array.

Testing two different pieces of code for speed.

Organizing your actionscript.

Fun with Random Numbers

How do I make a random number that corresponds to the frame I want to go to?

random() vs. Math.random() random wins.

Why Math.round(Math.random()*N) is evil.

No really, Math.round(Math.random()*N) is evil.

Generate random numbers with a bell curve / Gaussian distribution

Generate random numbers with a Normal / Gaussian distribution

Generate random numbers with a curved/exponential/non-linear distribution

Generate M unique random numbers from a list of N numbers - the most effcient way.

Generate 5 random numbers, but exclude one of 'em.

Choose between 4 different random frame numbers which are unrelated.

Generate a shuffled array of unique random numbers.

Use random number to choose a frame number.

Generate random number from MIN to MAX (numbers specified by user as text)

Fun with Dates & Time

Getting an internet radio station's schedule to show up in the visitor's local time (and correctly).

Comparing two dates to measure elapsed time.

Determine the number of days in a month by MM/YY

Determine if someone is 13 or older, based on birthdate.

Identify who's birthday is next (and how old they'll be)

Execute a script (such as a reminder) on a specific date & time

Add months to a YYYYMM date.

Loading relevant pictures based on local clock time

Display different messages (or jump to different frames) based on the hour.

Display days elapsed since a certain date

Display the time NN minutes prior to the current time.

Stuff a bunch of dates into an array.

Given month,day,year, figure out which day of the year (e.g. Dec 31 = 365 or 366)

Math & Physics

Approaches to learning Math & Physics

Getting smoother tweens.

Sine & Cosine are your friends

Sin & Cosine - how do they work?

Sin & Cosine - what are Radians?

Sin & Cosine - how I learned 'em

Hockey puck physics

Drawing a 5 point star with sin & cos

Tips for making psychadelic movies with Math

Pong Physics

Chaos Theory - Lorenz Attractor

Drawing a subdivision fractal

Generate random numbers with a curved/exponential/non-linear distribution

Why general-purpose physics engines may be a waste of time.

Chain effect connecting MCs (like a desk lamp)

Do you like the Bestiary? Want to see more free actionscript source code from Jim? Then make a donation! Thank you!!


Undocumented tween commands in MX2004

A collection of actionscript one-liners

How come _alpha = 5 produces funny numbers when I trace it?

How come trace(011) says 9? Fun with Octal.

How come 07 is valid, but 08 or 09 is not? (Fun with Octal Part 2)

How come I can't use 08? (Fun with Octal, Part 3)

Recognizing patterns in images (palms, thumbprints, etc)

Why you shouldn't buy any Macy's stock.

Using #include to dynamically load code (doesn't work)

C++ type pointers in flash

Break up 0xRRGGBB into R, G and B.


Copyright © 2003,2004 by Jim Bumgardner. All Rights Reserved.        Leave Jim some feedback