How to Create Candle Flicker in AS3

Creating a realistic candle-flickering animation for birthday scenes can be a lot of work in Flash ActionScript 3 (AS3) -- if you don't use open-source AS3 code. Candle flicker AS3 code, however, turns turns this difficult task into a piece of cake. With flicker code you can quickly create candle flicker that can be customized for specific colors, specific dimensions, different candle-flicker rates and different flickering effects. You can also create multiple candle flames that can be placed anywhere in your Flash movie.

Things You'll Need

  • Adobe Flash Professional: CS3, CS4 versions
Show More

Instructions

    • 1

      Download the candle flicker AS3 code, which is found at the Ntt.CC website.

    • 2

      Start your Flash program. Click "Open" from the "File" menu and navigate to the "fire" folder that was downloaded. Select the "fire.fla" file in the "fire" directory and then click "Open"

    • 3

      Click "Test Movie" from the "Control" menu to run the "fire" movie. Observe that a realistic flickering candle flame is animated.

    • 4

      Click "Open" from the "File" menu and navigate to the "fire" folder that was downloaded. Now navigate to through the sub directories of the "fire" directory until your reach the sub directory defined by the directory path "\fire\src\com\trick7\effects." Select the "TeraFile.as" ActionScript 3 file and click "Open"

    • 5

      Examine the code in the "TeraFile.as" file. Locate the lines that declare the variables that control the color of the inner flame and outer flame ( (var fireColorin and var fireColerOut), the width and height of the flame (fireWidth and fireHeight) and the horizontal and vertical flicker rate of the flame (phaseRateX and phaseRateY. Change these variable values to change the color, width and height of the flame as well as the horizontal and vertical flicker rate of the flickering flame. Click the "Save" option from the "File" menu to save the changes made to the "TeraFire.as" file.

    • 6

      Click the "fire" option from the "Window" menu. Click the "Test Movie" option to run the modified candle flicker movie and observe the effects the changes you made have on the flame.

Learnify Hub © www.0685.com All Rights Reserved