Showing posts with label flashlite battery status indicator. Show all posts
Showing posts with label flashlite battery status indicator. Show all posts

Tuesday, December 7, 2010

How to make simple Battery Indicator using flashlite

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

Sunday, December 5, 2010

Displaying Network Name in Flashlite

Important: First Setup Your Flash Professional 8 by clicking here

Skill level : Very Basic.
Duration : 2 Minutes.

Flash Professional 8 Shortcuts
T : Text tool
V : Selection tool
F9 : Action Frame
ctrl+F3 : Properties Frame

This is the simplest tutorial for displaying the NETWORK NAME on the phone's screen using flashlite. We just need to create a dynamic text box, and add two line code to it and we're done.
Look at the example below dislaying network name using flashlite:

image ex1.png


STEPS

1.) Press T (Text tool) on your keyboard to select the text tool or Press the button as shown in the image below.

image 1


2.) Make a small rectangle (big enough to contain the network name), write No Network inside the textbox. This will be your default display if the phone is out of coverage area or when phone is in Offline/Airplane Mode. Now press Esc(Escape button) on your keyboard to close the text tool.

image 2


3.) Now press V (Selection tool) and select the rectangle by clicking( single click ) on it.

4.) Now Press ctrl+F3 (Properties Frame) and set the variable name as display (You are free to use any word or text for the variable name), make sure this text box is a dynamic textbox( refer the image below ). Chose the font color (other than black if your background color is black) and then change the color, and font size as you desire.

image 3


5.) Now press Esc Key on your keyboard OR click outside the text box. Then Press F9 (Action Frame) to open the Action Frame and paste the following code

1. fscommand2("GetNetworkStatus");
2. fscommand2("GetNetworkName","display");


important: The variable name display on line 2. of the code should be same as declared for the variable name for the text box earlier.

6.) Save this movie and send it to your phone and see it in action.....

Click here to download the example Network-Name.zip