I really enjoy receiving e-mails/comments from people who discover new and interesting things. The whole dynamic wallpaper with Walkman features has not really been covered on this site, mainly because my phone will not support them =(. Either way, I will try to get a newer phone which supports this and soon I will get some tutorials up and running.
In the meantime, Martin has a pretty useful tidbit of information to share, with regards to displaying the song name in your wallpaper for phones with Walkman feature. Read the following:
I just thought that i will quickly write down, that because I am developing a wallpaper for my W580i, I wanted to show the ID3 tags. And using this worked, to display the title, all i did was create a new layer "Title". The create a dynamic text box on this layer with the variable TITLE. Then paste that code into the action layer, and underneath it write "fscommand2 ("MP:", "TITLE");". Now it displays the title when music is playing, and disappears when it is not. I suppose it will be like this for the rest as well, which I am about to try.
Thanks for your comment! And please keep the emails coming!
I'm excited to announce that Flash Lite Tutorial is one year old! It just seemed like yesterday when I started learning about Flash Lite on my w300i. A big thanks goes out to all those who have supported me and my endeavours! School is keeping me busy at the moment, but I promise to have some new fun tutorials out in the summer!
Hey guys - it's been a while since I've posted a tutorial. I've been terribly busy with my school studies, that I barely have time for myself, let alone write a tutorial. But now that I am done exams and the holiday season is upon us, here is my gift for fellow readers out there. I hope you enjoy it!
Dynamic Wallpaper: Part 1: Sunrise, Sunset
With the onset of new SE phones being able to support standby swfs, we see a growing number of standby swfs that are animated in such a way that they change according to the time of day. Wouldn't it be nice to see an evening landscape when it's dark out and a bright meadow during the afternoon? Let's see how this is done!
Above is an swf example of the 'animation' we are aiming for. Obviously, the background should only change as time progresses, but I just wanted to give you an idea of what the end product would be like in summation.
The trickiest part of this project is creating the effects that corresponding to sunrise and sunset; the actionscript is incredibly simple and you have probably seen it already. In this tutorial we are aiming for mountain scape, where the dynamic components are the sun, moon and sky colour.
Therefore, we first need to create 3 graphic symbols that correspond to the sun moon and sky. Since we will need to change the colour of these symbols using the Color properties, we will create these symbols with a white fill. When creating your graphics, try to center them onto the crosshair using the Align tool. That way, it will be easier to select the appropriate colour tween. The sky will just be a white rectangle, the sun a circle, and the moon a will be a yellow crescent. Because I felt the moon is generally a static colour, I decided to keep it one colour. The others may change colours, so I felt it would be easier to keep them white and apply a tint later:
Next, we create a new movieclip that will house the entire 24 hour animation. The easiest way to create this animation is to have the frame length set at 24 frames, but I feel that it would be pretty choppy, so in this tutorial, we are creating a 48 frame animation. The frame numbers will correspond to:
TOP 1) Foreground (we will use a mountain scape) Motion Guide (todirect the motion tween of sun and moon) 2) Sun (will contain the sun animation) 3) Moon (will contain the moon animiation) 4) Background (this will contain the sky) BOTTOM
Here is the overview of the movieclip timeline. You can refer to this later:
We will go through each layer individually.
Foreground: This will be the top most layer and will be the graphic you would like to display in the forefront of the landscape. This can be anything to your liking such as trees, houses, buildings. For this example, we use a mountain range. Be sure not to cover up the whole stage, or else you will not be able to see the background sky change colours. Don't mind the other layers on the picture below:
Background: The background will contain the sky graphic symbol undergoing a motion tween (colour change). First off, we need to determine the appropriate colours of the sky at various times of day while keeping in mind that there are 48 frames to represent 24 hours in the day. Here is what I chose. This is a very plain and vague colour scheme which can be definitely improved upon.
Frame 1 (Midnight): #000000 (will look like #353535) Frame 20 (10:00 am): #4CA3FA (will look like #71B6FB) Frame 30 (3 pm): #4CA3FA (will look like #71B6FB) Frame 48 (11:00pm): #000000 (will look like #353535)
*IMPORTANT: Remember that our original sky symbol was white! This means that the symbol will appear a few shades lighter when you add the tint. The tint colour will not be equivalent to what is shown in the symbol!
To apply these colour changes, first create keyframes on frames 1,20, 30 and 48, and apply a motion tween between them. Then select the keyframe and symbol, then select Color: Tint at the bottom properties menu. I chose Tint over Advanced because I can use the dropper tool to select the appropriate colour instead of guessing the RGB values.
Sun and Moon Layers: These layers will use the same concepts as the sky colour change tweens except we add one more dimension: a motion tween guide. A motion tween guide lets the user designate a path for the symbol to travel while it is undergoing a motion tween. This is appropriate for the sun and moon animations because sunrise and sunsets have a curved path, not straight!
First create the two layers that house the Sun and Moon symbols. Next, right click the sun layer and select Add Motion Guide... This will create a new pseudo layer which will be the parent for the Sun. Next, move the Moon layer upwards so that it becomes under the Motion Guide as well. We put them in the same guide because for simplicity, they will rise and fall in the same path. (Look at the MovieClip Timeline picture)
After this is complete we have to start creating the path for the moon and sun to travel on. Selecting the Motion Guide layer, choose the line tool and roughly draw out a curve for which you want the sun/moon to follow. Now, remember that during the day, the moon doesn't need to be on stage, and during the night, the sun doesn't need to be on stage.
I decided the sun should rise at around 7/8ish am; this corresponds to around Frame 16. So, select the sun layer: Frame 16 and place the sun on the stage such that the crosshair is centered on one part of the curve you drew in the motion guide. Now, create a keyframe at frame 25; this corresponds to around 12 noon, so now, move the sun so that the cross hair is at the top of the curve. Now, create a keyframe at frame 35, and move the sun so that its the right most side of the curve.
Now, you can select each keyframe (16, 25, 35) and change the colour properties of the sun: it is more orange during sunrise and sunset and more yellow during high noon. Fiddle around with the tint tool to get the best colour. You can see what I did in the above diagram.
Now, we can repeat the same steps for the moon layer. But remember that because the moon rises at night, the motion tween will begin at the ENDS of the timeline. Make sure that the moon is placed in the exact same place at Frame 1 and 48, so it can be continuous.
The Main Timeline:
Now, place your created movie clip in the main timeline on frame 1. Select your movieclip, and give it the variable name: background. Create a keyframe at frame 6.
Right click Frame 1, add the following actionscript:
//this will get the current time and convert it to a number between 1 and 48. /:theHour=FSCommand2("GetTimeHours") * 2; /:theMinutes=FSCommand2("GetTimeMinutes"); /:hourFraction = Math.round((/:theMinutes/60) * 2); tellTarget("background"){ gotoAndStop(/:theHour+/:hourFraction+1); }
Right click Frame 6, add the following actionscript:
gotoAndPlay(1);
There you have it! Now compile and test it out! The movie will check the time every 6 frames and update the movieclip to reflect this. So in a sense, it seems continuous on the viewer's perspective. You can test this easily by previewing on computer, and changing your system's clock, and see the flash file update the background automatically!
EXTRA TIP: If you want the animation to seem more realistic, you can use motion tween easing for the movement of the sun and moon, so that it slows the most when it reaches the peak of the curve.
In the previous Password Protection Tutorial, we explored a simple solution to creating a password entry prompt that enables a certain degree of privacy when accessing their flash lite menu. I have received a couple responses from users wanting to know how to create a backspace function so that if the user accidentally keys in the wrong digit, they can 'backspace' and re enter something new. Here is what I'm talking about:
Click the swf and press 15403 and press enter. It will display an incorrect password message. Now type in 15403, then press the left key, then press numpad digit 2. It will remove the last digit you entered and append on the correct one instead. This backspace function can be easily created by considering a couple String functions that come with flash lite 1.1
There are 2 functions we will use: length() and substring().
The length(string) function returns an integer representing the length of the string you have given it. For instance:
theWord="apple" numLetters = length(theWord); trace(numLetters); //OUTPUT will be 5
The substring(string,index,count) function returns a string variable.
string The string from which to extract the new string. index The number of the first character to extract. count The number of characters to include in the extracted string, not including the index character.
theWord="snapple"; theWord1=substring(theWord,0,3); trace(theWord1); //OUTPUT will be 'sna'
The Backspace Function
The backspace function is a great example of how these two string functions can be used together. Pressing the backspace button once, will essentially run a substring function that returns a string that is one character shorter. The one liner for this is essentially:
//we only want this to occur when the variable has characters in it if(length(/:realPW)>0){ /:realPW = substring(/:realPW, 0, length(/:realPW)-1); }
Implementation into Password Protection
Continuing from our previous password protection tutorial, select the button you had placed on stage that listens to the buttons pressed. Right click and click Actions... At the very bottom at the following code:
//we designate the 'backspace' button to the left key, but you can change it to whatever you want on(keyPress ""){ call("backspace"); }
'backspace' corresponds to a pseudo function we will create. In the area of the timeline designated to these pseudo functions, create a new blank keyframe and give it a frame label of 'backspace'. Right click the blank keyframe and choose Actions... Enter the following:
We need to execute the code for both the entered password and the corresponding asterisks that appear on screen. If we don't do this, the number of asterisks on screen would not match up with the number of keystrokes entered.
There you have it! Now you can backspace passwords you enter.
Oman3D has posted a comprehensive tutorial on creating a simple flash lite 1.1 game using Flash 8/CS:
This tutorial will teach you how to create a Flash Lite game playable on the Flash Lite Player version 1.1 - one of the earliest versions and most restricted, but the most widely spread version as well. Our basic game could be created without using the advanced features provided in later versions. Adopting Flash Lite 1.1 will guarantee that the game will be compatible with the largest possible number of Flash Lite powered devices.
For more information on this, please read their tutorial.
Lots of people I see on SE forums want their flash menu customized so that they are password protected. I guess it gives an extra dimension of privacy which is important for some. In this tutorial, we'll look at a simple solution to creating a fully functional password screen that can be customizable to whatever numerical password you wish.
This will be Part 1, which will give you the basics on how to create this password protection. Note that this is a simplified version and we will cover other things (how to backspace) in later tutorials. Here is a preview. Click on the swf and enter the password (15402) and press Enter.
Is it possible?
First off, let's talk about what's involved. For one, Flash Lite 1.1 does not support reading or writing to file. Second, it does not support so-called "flash cookies", or more officially, "Mobile Shared Objects". So what can we do? One solution I have proposed is simply designating your wanted password into variable name. The great thing about this is that the numerical values are preserved upon compiling such that the values can be read and consequently changed using a hex editor. So for one, you can customize the password by editing the swf in a hex editor. However, once on your phone, it will not be changeable, though it may be possible with some file explorer and text editing applications. Oh well, better than nothing right?
But wait, how about input fields? Why don't we just use one of those? Although it does allow for alphanumeric data entry, I find the system extremely tedious and requires the user to go through a lot of work just to enter data. I feel that a cellphone user doesn't want to spend a minute entering the password just to unlock a menu. Just try creating a simple input field and see how it functions on your cellphone and you'll see.
The Algorithm
The way we will accomplish a password protection system without input text fields is by creating a mini loop at the beginning of the movie. A button listener will listen for digits pressed and the Enter button being pressed. It will compare it to the real password, and if valid, will allow the flash lite to proceed to the flash menu. We will mimic an input system by appending asterisks to a dynamic textfield as the user continues to press numpad buttons.
Let's Begin
First off, we need to create a button. In the main timeline, create a layer and place the button on it so that it is not on stage. Right click and select Actions... to add this following code:
Yes, I know the code is quite repetitive, but I haven't found a more efficient alternative. Basically, this code relays the number that's pressed on the pad and passes it to a pseudo function using the call function. Pressing enter will call another function to evaluate the validity of the numbers pressed.
Now, create another layer. On frame 1, you will define the password you want to use:
/:pwWord=12345;
For now, we can only use numbers, as it is the easiest thing to do. Give frame 1 a frame label called "Idle".
On frame 1, you will also need to add a dynamic textfield. Give it a var name pwBox. This will house the asterisks that will be appended when you press a numpad button; center the text and be sure to limit the textfield to one line. To mimic this textfield to look like an entry form, you can add a backgroup image that looks like a textfield.
You will need to add another blank dynamic text field with var = error. This will house any error messages that will pop up after you enter an incorrect password.
TIP: Make sure the font colour of the dynamic text fields are selected so that they are different from the background!
You may also want to add some additional titles, prompts and some instructions on frame 1 to tell the user to enter a password.
Now, extend the duration of the frame to 7 frames. On frame 7, create a keyframe and add the acrionscript:
gotoAndPlay(1);
This ensures that the movie stays in the password prompt area, and not proceed to the actual flash menu.
Now, create blank keyframes on Frame 8, such that all of the placed items are no longer on stage.
On frame 10, (on any layer you want), create a BLANK keyframe. Give this frame a label named 'addDigit'. This blank frame will contain the code to be executed when the user presses any numpad button, which will trigger the call function for 'addDigit'. Add the code:
//pwBox refers to the dynamic text field we have added in frame 1. By appending an asterisk, we give the effect that the password is actually being entered into the text field. In fact, this is NOT the case, we are simply appending to a variable. /:pwBox= /:pwBox add "*"; //the variable realPW represents the entered password; with every numpad button presses, it appends the value 'digit', which is declared in the button listener /:realPW=/:realPW add /:digit; gotoAndPlay(1);
On frame 11, (on any layer you want), create a BLANK keyframe. Give this frame a label named 'evaluate'. This blank frame will contain the code to be executed when the 'enter' button triggers the call function for 'evaluate'. Add the code:
//this compares the defined password with the real password that has been entered by the user. We use 'eq' to compare strings. if(pwWord eq realPW){ //we advance to the actual menu is the password matches gotoAndPlay("Flash Menu"); }else{ //error refers to a dynamic text field that's at first empty in frame 1. Once the password is incorrect, text will pop up in the field prompting the user to re enter the password /:error="Incorrect Password.\nPlease Re-enter."; // if the password is incorrect, we need to immediately clear the previously entered password as well as the asterisks present in the text field. /:pwBox= ""; /:realPW= ""; gotoAndPlay(1); }
Now, on frame 15, create a blank keyframe named "Flash Menu". This is where the flash menu can be placed. From the code above, you see that we jump to this keyframe when the password is correct.
Hex Editing to change Password
There you have it! A nice password protected flash menu. Now, for kicks, if you compile the swf and reopen the swf in a hex editor, you can easily see where the variable name is defined, and you can change it to whatever you like!
Something to think about:
Nonetheless, there are some drawbacks to this method: 1) You can only use numerical passwords 2) Although the password length is essentially as long as you want it to be, the text field that contains the asterisks will overflow. 3) You can't backspace at the moment (check back for a later tutorial)
Is it possible to create functions in Flash Lite 1.1? I'm having problems getting it to work...
This is good question. First off, Flash Lite 1.1 does not support functions. This is a major drawback, as applications, especially games use functions to impart versatility and efficiency. Fortunately, there is a solution to this problem, and it is in the form of the function call():
call(frame);
To illustrate this concept, place a button listener on stage, and enter the following code, by right clicking and selecting options:
on (keyPress "1"){ call("jimmy"); }
In the above code, jimmy refers to the frame name that will we will be executing code from. Now extend the duration of frames to 5 frames. On Frame 5, add:
gotoAndPlay(1);
This guarantees that your movie will be always within frames 1 and 5. Now, add a blank keyframe on frame 6 so that the button is not on stage. Name this frame jimmy. Add the following code:
trace("Code executed!");
Now, compile the code and see for yourself. When you press '1', it will pop up with a message window (in your emulator) saying "Code executed!". This shows that the code from frame 6 was executed. More importantly, it DOES NOT move the movie to that particular frame (your button is still on stage, meaning its still playing between frames 1 and 5). In essence, we are just calling the code from that particular frame, and NOT playing the content of that frame. From CS3 Documentation: The default form executes the script on the specified frame of the same timeline where the call() function was executed, without moving the playhead to that frame.
So as you can see, this is pretty much equivalent to creating functions. The only difference is that each labelled keyframe you make represents a different function. For best practice, you can place these at the end of your movie so it doesn't interject anywhere and also helps make your movie more organized.
When I start browsing around the internet to look for interesting flash lite applications for Sony Ericsson phones, the majority of results land on flash lite menus. Let's face it, they're slick, animated and aesthetically pleasing: who wouldn't want one? Everyone wants a cool flash lite menu to show off to their peers. I would've expected this potential area of interest to be booming at a phenomenal rate, but the fact of the matter is that SE makes it very hard for us to create and implement these menus.
First, let's consider how one needs to implement these flash lite menus. It's not something an ordinary cell phone user can achieve without learning and download tutorials on the special programs, drivers, files needed to get the flash files into the right directory. Moreover, you risk screwing up your phone if the process of moving that file somehow goes wrong. Let's not forget that the programs do not currently support CID 51/52. Because the directory in which swf files exist are within the file system of the phone, one can not just plop the file into their internal or external memory to expect it to work. This is by far the biggest problem that's limiting this sector from expanding.
Many of you have contacted me with potential ideas on how to get around this idea, but after several weeks of fidgeting with directories and themes.xml, I'm afriad I can't find a solution to this problem. It really seems as though SE wants to keep this flash lite creation business in control. With no leads as to what the solution is, my attempts are comparable to finding a needle in a haystack.
Second, there are very little resources out there that teach people how to create these menus. Albeit, there are intelligent, and generous users out on forums who dedicate their time on understanding how the code works with flash decompilers and hex code editing, but it's very tedious and time consuming. That's one reason why this site exists. So for those users out there who think it's super easy to convert FL2 to FL1.1, or changing resolutions, take some time and think about the amount of work needed just to change something. In fact, I have yet to see that many flash menus created from scratch; most of them are just slight variations on flash menus created by SE.
Lastly, SE's flash lite only works in browsers and may the prime reason why animations run so poorly on several select phones. On the bright side, we are seeing more phones compatible with flash wallpapers that do not require a specific directory to operate. While the current outlook on flash lite expansion seems like a struggle, I am truly optimistic that SE can turn things around by realizing how many potential flash lite developers are interested in creating applications for their cellphones.
We continue our series of useful dynamic aesthetics with one associated with the winter season. Wouldn't it be nice to have a nice snowy landscape as a wallpaper and better yet, have snowflakes falling in the forefront? We will discuss in this tutorial how to transform your ordinary snowy landscape into a winter wonderland!
The idea of falling snowflakes can be achieved using actionscript very easily and is almost identical to the code used for the ripple tutorial I wrote earlier. However, in this tutorial we aim for more realisitc effects, such as:
1) Snowflakes that fall non linearly (they can move side to side) 2) The falling speed of the snowflakes differ 3) The above two effects are randomized.
To understand how we achieve this, you must first be familiar with a bit of trigonometry. The function y=sin(x) mathematically yields a wave like shape that repeats itself every 360 degrees (2 pi) returning a maximum and minimum of 1 and -1.
So, using this function, we can randomly generate an x value so that the starting point in the wave will differ. By incrementing the x placement using this function we can allow the snowflake to move right and left in a natural sense. Randomly incrementing the y direction will change the speed the snowflakes fall.
First, we will create a movieclip symbol named snowflake_mc. Inside this symbol, create a graphic to use for the snowflake. For simplicity, we will use a circle:
Second, create a new movieclip symbol named snowing_mc. Inside this symbol, place the snowflake_mc symbol created above inside on frame 1, and give it an instance name 'snowflake'. Create a keyframe on frame 2. Right click frame 2 and add the following code:
//Everytime the movie loops to this frame, it will update the extent the snowflakes move to the right and left, as well as its falling speed //Amplitude measures the maximum X value displacement you want //Phase defines where in the sine function the snowflake begins at. snowflake._x +=amplitude*Math.sin(phase); snowflake._y +=speed; //this increments the sine function phase+0.2; //if the snowflake has reached the bottom of the screen, remove it (memory conservation) if(snowflake._y>(/:YRes+15)){ removeMovieClip(_root._name); }
Now switch to the main timeline:
Frame 1: Place the snowing_mc symbol onto the main area, but off-stage (not in the visible area). Give it an instance name of 'snow'. Also add the following actionscript:
This 'counter' serves dual purpose. It helps create a pseudo array of movieclips and also designates which layer the movieclip will be placed. X and Y Res are values you should change according to which phone resolution you're creating your swf file for. For example I used 128 x 160 because my w300i is fitted for that resolution. MaxOnScreen refers to the maximum number of snowflakes you want on the screen. Remember that the more you have, the more processing requirements are needed on your phone.
Now, add a KeyFrame on Frame 2: Add this actionscript:
//This will generate a random number between 0 and XRes to place your snowflake /:randomX=random(/:XRes); //This creates a new movieclip in a pseudo array format (ex: snow0, snow1, snow2, etc.) using the counter we created in frame 1 duplicateMovieClip("snow", "snow" add /:counter, /:counter); //This places the created movieclip into a correct position eval("snow" add /:counter)._x= /:randomX; //We place it above the stage to ensure you don't see magically appearing on screen eval("snow" add /:counter)._y= -10; //This phase value determines where in the sine function we start. We use this value in the snowing_mc where we define the x movement of the snowflake eval("snow" add /:counter).phase=random(360); //Here we define the amplitude variable randomly so that some snowflakes move left/right more than others eval("snow" add /:counter).amplitude=random(3); //Here we define the speed eval("snow" add /:counter).speed=random(3)+5; /:counter++; //We recycle our counter to conserve memory if(/:counter>/:MaxOnScreen){ /:counter-=/:MaxOnScreen; }
Please note that the variables: amplitude, speed, and phase are up to you to define. You need not to follow exactly the code I have written above. In fact, I encourage users to test out different values to develop the optimal numbers to use!
Now create KeyFrame at frame 15 and add the line:
//this will loop back to frame 2 to generate a new snowflake gotoAndPlay(2);
Voila, compile in FL 1.1 and you will see snowflakes falling on your video. Note that we didn't explore all the possibilities of snowflake dynamics in this tutorial (such as snowflake type, size, colour), but you can easily incorporate those effects using past tutorials I've written. There are also several different things to modify in this algorithm such as:
1) Frame duration between Frame 2 and 15 (This will change how often a snowflake appears) 2) Frame duration between Frame 1 and 2 in snowing_mc (This will change how often the snowflake changes position) 3) The variables amplitude, phase, speed (snowflake dynamics) 4) MaxOnScreen (how many snowflakes you see at once)
Let's take a rest from Flash Lite just for a minute. I just came across this really cool application called MeBoy:
MeBoy is a Gameboy emulator for mobile phones (which means you can use it to play Gameboy games on a mobile phone). It works on phones with support for Java Micro Edition, specifically MIDP 2.0. Your phone manufacturer's web site can tell you if this includes your phone.
This means you can load up Gameboy (and Color) ROMs onto your cell phone and play them. I decided to give it a try with my SE W300i. A great added function for v 1.4 is the ability to shrink fit, meaning your screen can be shrunk to fit on your cellphone screen if it's too small; this was great for my 128x160 screen. Also, the rotate screen function also makes lets me maximize the screen for a larger display, albeit more awkward controls. However, you get the flexibility of designating all the controls which is nice.
Gaemplay is surprisingly good on my w300i, averaging around 20fps at most times. But to be honest, there is a noticeable decrease in performance in certain circumstances (fading, transitions) but I guess you can't expect too much. Another big downer is the current lack of audio support. Oh well, I guess you can't have it all. Either way, it's still great to see this program bring back the great Gameboy games of our time. You can visit the developer site here: MEBoy.
Now, back to flash for a minute: wouldn't it be cool if emulators could be created in Flash (or flash lite?). Would be pretty awesome, but I honestly have no idea if that's even possible. Just a thought...
Lots of the new flash wallpapers out there feature cool randomized aesthetics which make it look really nice. In this tutorial, we will create a randomized ripple like effect using Flash Lite 1.1. I'm taking a simplifed approach to this and is fairly simple to understand.
This can be achieved with two symbols. First, create a movie clip symbol called ring_mc. Inside this symbol, create a simple ring shape like so:
Next, create a movie clip called ripple_mc. Inside this movieclip, place ring_mc symbol inside frame 1. Give the placed ring_mc an instance name, called 'ring'. Extend the frame duration to 4 frames. At frame number 4, add a keyframe and add the following script: I have made comments to show you what it does:
//increase the size of the instance ring ring._xscale+=5; ring._yscale+=5; //make the instance more transparent ring._alpha-=10; //after the instance expands to a certain degree, remove the symbol from stage if(ring._width>150){ removeMovieClip(_root._name); }
From the above code, you can see that the increased size and decreased alpha will give it a ripple effect as the movie continues to loop. The last couple of lines above are more to conserve memory: we don't want all these symbols to accumulate on stage when we randomly place them.
Now, switch to the main timeline. Let's take this frame by frame:
Frame 1: Add Keyframe Place the ripple_mc symbol onto the main area, but off-stage (not in the visible area). Give it an instance name of 'ripple'. Also add the following actionscript:
/:counter = 1;
This counter serves dual purpose. It helps create a pseudo array of movieclips and also designates which layer the movieclip will be placed!
Now, add a keyframe at Frame 2: In frame 2, add the actionscript:
//these two lines generates a random number: since we want to randomly place a movieclip in X and Y directions, we need two random numbers*/ //the numbers in the parentheses depend on your screen resolution (here it is 240 x 320) /:randomX=random(240); /:randomY=random(320);
//here we generate a random size for the rippled to be scaled to //we add 30 so that they are not too small /:randomSize=random(120)+30;
//this is the most important line: it duplicates the instance we placed on stage (ripple) and gives it a name (ripple1, ripple2, ripple3 etc) based on the counter. The last parameter is the layer which each movieclip will be placed on (1,2,3,..). Only one movieclip can exist on each layer, so that is why we increment everytime a new movie is instantiated duplicateMovieClip("ripple", "ripple" add /:counter, /:counter);
//these four lines scale and place the created movieclip onto the stage eval("ripple" add /:counter)._xscale= /:randomSize; eval("ripple" add /:counter)._yscale= /:randomSize; eval("ripple" add /:counter)._x= /:randomX; eval("ripple" add /:counter)._y= /:randomY;
//we need to increment the counter so that when this code is executed again, a new movieclip with a new instance name will be created /:counter++;
//since we know that it is unrealisitc to have 10 ripples on stage at once, we can loop the counter to save on memory and to reuse some layers if(/:counter>10){ /:counter-=10; }
Recall back in the ripple_mc we had an if statement to check on the size. This is to 'double check' on the ripple size: if it's too big we will remove it to save memory.
Now, add a keyframe at frame 25 and add the line:
//this will loop the movie gotoAndPlay(2);
There you have it! Remember that this is just a tutorial, and a lot of things can be modified to fit your needs. Such as :
1) How much you want to increment the _xscale, _yscale and _alpha 2) The frame duration of ripple_mc (how often the ripple expands) 3) The frame duration between frames 2 and 25 (how often a new ripple appears) 4) Frame Rate!
What is the actionscript that receives the music info from those standby menus?
Taking a look at some commercial SE standby swfs, it looks like the key to displaying music information is the following command:
loadVariables("MP:",_root)
However, it seems as though this function is only supported in phones that run walkman player 2.0 [credit: peter3334], which are usually the phones that are able to run wallpapers. From here, it looks as though the variables imported are: TITLE, ARTIST and ALBUM. The actionscript associated with displaying, updating and formatting this information definitely seems more complicated than the ordinary flash lite menu...
Lithium3r has taken the time to convert a FL2.0 standby (for the w910) to FL1.1 standards, allowing many more SE phones to run this nice standby menu. Way to go! Here is a screenie:
Some users have shown interest in learning how to incorporate sound into flash lite menus and other applications. Here is a very nice starting point: a tutorial from SE outlining the necessary steps to implementing sounds into FL1.1
I'm happy to announce that the latest flash lite menu is available for download. This new menu, called 'Aura' features my first menu with a circular icon motion (using a motion guide) as well as a nice analog clock in the middle. The beautiful icons used in this menu are not my own; they are from gakuseisean'siVista icon pack. Many thanks goes to him for giving me permission to include these stellar icons into my menu system. You can visit his website here.
Due to feedback from the SE-NSE forums, I've decided to switch the background to a black colour and must admit it does look better! The menu is available in 3 resolutions:
The zip file contains the thm file (it is very basic), readme and swf file.
For those who are hungry for more SE flash lite menus, peter3334 over at se-nse forums have generously uploaded his collection of over 100 menus in 3 different resolutions. You can take find them here
Unfortunately they are not supported. This has been a common question, as it is definitely an important component in creating icon menus as it drastically simplifies the process. However, what you can do is create a pseudo-array where you name variables using actionscript and a counter, like so:
This will set the variable 'numbers1' equal to one: eval("numbers1") = 1;
This will set the variable 'numbers2" equal to two: eval("numbers" add 2) = 2;
If you want to create the range of variables "numbers1" to "numbers9", then you simply do the following:
For a typical SE flash menu with icon scrolling, you will have a movieclip that contains each of the 12 icons in each frame. There will be a stop() command on frame 1 to keep it from playing. You will place 5 of the same movieclips on stage, and give them instance names icon0, icon1, icon2, icon3 and icon4. Now, if you want to designate which icon they want to show, you can easily accomplish this through a for loop :
for(/:x=0;/:x<7;/:x++){ tellTarget("icon" add /:x){ gotoAndStop(/:x); } I found this method particularly useful in designating and changing icons in flash lite menus.
I want to randomly place a symbol somewhere on stage, but I want it to stay anchored around a specific point so it won't wander off the stage. What can I do?
This was previously covered in the Vibrating Objects tutorial. Here are the steps:
1) Create a graphic symbol of the object you want to randomly place 2) Create a movieclip, place the graphic symbol inside. Give the graphic an instance name: we will call ours ball. Extend the movieclip to 2 frames long. 3) In Frame 1 of the movieclip, add actionscript:
4) Place the movieclip on the stage and place it directly where you want it to be anchored. 5)In frame 1, or whenever the movieclip is beginning, add actionscript in that frame:
6) Determine what x and y displacement you want for randomly placing your graphic. If you decided you want it to displace 5 pixels, then you would add the following line:
/:boundary = 5;
That's it. If you want to control when it will randomly place, and when it will not, obviously you can place a stop() command in frame 1 of the movieclip and tell it to play whenever you want. Also, if you want to displace the graphic in the x and y directions independently, then you can declare a variable called /:boundary_x and /:boundary_y, and then replace the /:boundary variable found in the calculations for /:x_displacement and /:y_displacement.