My Flash Resource – New Ideas and News for Applying Flash to Complex Gaming Apps

Latest News and Developments

May 31, 2008

For Beginners: Want Gradients?

by @ 10:32 am. Filed under Flash Tutorials

Hats off to webwasp.co.uk once again for providing another very useful tutorial about how to apply gradients to your Flash creations.

As with the RNG tutorial we listed the other day, this Gradient tutorial moves literally click by click through the various steps necessary to use the Gradient tool.

The tutorial is self rated as “easy” by its authors. You’ll need basic knowledge off how to use the selection tool, Color-Mixer, ability to Adjust Gradient settings, and the Gradient transform tool. All of these are readily available in your Flash 8 installation, so don’t worry!

Also, to customize the gradient per your needs, the tutorial also specifies how to use the image control handles to manipulate the appearance of your object.

Gradients can their width, size, rotation, focal point, and absolute center altered – so the sky is the limit with what you can do!

Enjoy….
WebWasp Gradient Tutorial for Beginners

May 25, 2008

For Beginners: Flash Random Number Creation

by @ 5:55 pm. Filed under Flash Tutorials

WebWasp.co.uk has a great “click by click” tutorial for beginners regarding how to generate random numbers. In the example provided on the website, a Flash button programmed by Action Script displays a random number between 1 and 10 in a predefined window space.

If you click the number button repeatedly, another random number appears.

Beginners will love this easy tutorial, which shows all the steps necessary to recreate the example .swf file offered by the authors.

Here are some code snippets from the tutorial:

Step …

5. If Script Assist is on, Switch it off:
6. Type (or copy and paste) the following code in the Actions Panel;
on (release) {
myDisplay = random (10) +1;
}

7. Test your Movie: Control > Test Movie (Ctrl Enter)

The ActionScript Explained:

on (release) {
When the user releases the Mouse button what is between the curly braces …

myDisplay = random (10) +1;
In this case the random function creates a random number that starts at 0 and ends on the 10th digit. Which is the number specified in the parentheses: (10). If you start your count from zero (instead of 1) then the 10th digit is 9 (not 10)! So to make it count form 1 to 10 I simply add one to the result. Hence the +1.

}
The curly brace ends the on (release) statement.

The next code snippet creates the non-repeating random number effect. This is slightly more complicated, but does come with a working example file:

The ActionScript attached to the button is as follows:

on (release) {

// Sets the number of digits in the random sequence:
var mySetting = 3;

// Creates a random number:
myNumber = random(mySetting)+1;

// Checks to see if it is repeating itself:
if (myNumber == myTemp) {
// If it is repeating it generates a new random number:
myNumber = random(mySetting)+1;
// Continues as above:
if (myNumber == myTemp) {
myNumber = random(mySetting)+1;
if (myNumber == myTemp) {
myNumber = random(mySetting)+1;
if (myNumber == myTemp) {
myNumber = random(mySetting)+1;
}
}
}
}
// Displays the random number:
myDisplay = myNumber;
// Resets the variable to the new random number:
myTemp = myNumber;
}

Finally, after you’ve come this far, the tutorial concludes with a practical application of Flash Randon Number creation: Subbing the random numbers for 10 different instances of “Hello” in different languages.

Very Cool – It’s all here: Click by Click Flash Random Numbers

Next Page »

My Flash Resource - A continually growing collection of tutorials, thoughts and interests of a Flash Animator and/or Developer.

categories:

other:

New Feedburner Feed!


Feel free to syndicate.

Learning Material

Flash Resources:


Listed on BlogShares
  • Resources