This tutorial is similar to The Flashlite Network Indicator except the fact that in Battery Indicator we will have to show the "Battery Low" indicator at the 1st frame unlike in the last frame in The Network Indicator. In this movie we can also use any number of frames to show the Battery Information. Here we will use 10 frames, 1st frame shows the "Battery Low" information and then the battery level increases gradually...
Important: First Setup Your Flash Professional 8 by clicking here
Skill level : Basic.
Duration : 15 Minutes.
Flash Professional 8 Shortcuts
Q : Free Transform tool
R : Rectangle tool
T : Text tool
V : Selection tool
F5 : Insert Frame
F6 : Insert KeyFrame
F9 : Action Frame
ctrl+i : Align & Info & Transform Frame
ctrl+F3 : Properties Frame
STEPS
1.) Press
T (Text tool) on your keyboard to select the text tool or Press the button as shown in the image (1a) below.
image (1a)
Now write "NO Signal" in this textbox. Refer Image (1b).
image (1b)
2.) Now Press
F6 (Insert KeyFrame) and then press
delete on your keyboard to clear the frame. Now press
R (Rectangle tool) on keyboard and make a small rectangle near the bottom of
the screen representing the lowest level for the network. Image(2)
image (2)
3.) Now press
V (Selection tool) so that the rectangle tool turns to the selection tool.
Double click the rectangle and press
ctrl+i (Align & Info & Transform Frame), switch to the Align tab and click the
icons as shown in the image (3).
image (3)
4.) Now on the timeline click on the 10th frame of layer 1 and press
F5 (Insert Frame).
Refer image (4 a) and (4 b).
Image (4 a)
Image (4 b)
5.) Now right click on the 10th frame and select CREATE MOTION TWEEN.
Now click and drag the rectangle and move it to the center of the screen.
Or press
ctrl+i (Align & Info & Transform Frame) and in the ALIGN tab click the icons as shown in image(3).
Image (5)
6.) Now press
Q (Free Transform tool) and click and drag the edge as shown in image (6 left) to get a bigger
rectangle as shown in image (6 right)
Image (6 left)
Image (6 right)
7.) Then press Enter button on your keyboard to see the effect. This is how your movie should look like till now...
8.)
Create a new layer by clicking on the icon as shown in the image.
image (8)
Image (8)
9.) Rename this layer to " action ". Now double click on any frame and then right click
and select CONVERT TO BLANK KEYFRAME.
image (9).
Image (9)
10.) Now Select the first frame of action layer then press
F9 (Action Frame) and paste the following code
in the Actions - Frame.
levelsNumber=10;
batMax = fscommand2("GetMaxBatteryLevel");
batLevel = fscommand2("GetBatteryLevel");
batSource = fscommand2("GetPowerSource");
batLevel2 = Math.ceil(batLevel*levelsNumber/batMax);
if (batSource == 0) //if battery is not connected...
{
gotoAndPlay(batLevel2);
}
11.) Now Paste this code on all other frames of action layer.(Paste this code from frame 2 to frame 10)
call(1);
12.) Save this movie and transfer it to your phone to see it in action.......
Click here to download the
Battery-Indicator.zip