Wednesday, November 30, 2011

Adding Function Parameters in ActionScript 3

Learn how to make your functions more flexible by adding function parameters. This introductory Flash ActionScript 3 video tutorial will teach you how.

Writing Functions in ActionScript 3

Learn how to write functions in ActionScript 3 in this introductory Flash ActionScript 3 video tutorial.

Monday, November 28, 2011

PART 3 - Fun with ActionScript 3 variables: Complete the story - Introduction to Flash AS3 Variables


Create a new Flash ActionScript 3.0 document. Then copy the code below and paste it in the script pane of the Actions Panel. Do not read the trace statement! Just read the variables so as not to spoil the activity.

Your task is to replace the value of each variable with whatever is suggested in order to complete the story in the trace statement. Do not remove the quotation marks when you replace the values. Once all the values have been replaced, test your movie, then go to the output window to read your story. You can do this activity with a friend and try to think of funny and ridiculous values for each variable.

var popArtist:String = "name of famous pop artist";
var cheese:String = "name of type of cheese";
var chemElement:String = "name of chemical element";
var bodyPart:String = "name of external body part";
var internalOrgan:String = "name of internal organ";
var songTitle:String = "title of cheesy love song";
var fighter:String = "name of famous martial artist or boxer";
var fungalInfection:String = "name of a type of fungal skin infection";

trace("A new superhero has been spotted around campus, leaping from building to building. Who is he? Are you sure you wanna know?\n\nRumor has it that this superhero is a student on campus who was bitten by a radioactive " + popArtist + ". When he woke up, he felt very strange, but still decided to attend class. His classmates thought he was acting strange, and they began to avoid him because he started smelling like " + cheese + " mixed with burnt " + chemElement + ".\n\nBut things changed when a crime occurred on campus in the afternoon of that same day. A young girl was being held at gunpoint, and was being asked to surrender her fake " + bodyPart + ". Then out of nowhere, a blurry figure came rushing to save the girl! It was the student who smelled like " + cheese + " and " + chemElement + "! He was now dressed in a lovely costume designed by " + fighter + ". With great speed, he went straight for the gunman and kicked him right in the " + internalOrgan + ". He kicked him with such great force that it made the gunamn scream: " + songTitle + "! And then the gunman ran away. The young girl was safe. And the students cheered!\n\nHappy and thankful, the young girl came up to her savior, gave him a kiss on the cheek and asked, \"What is your name, kind sir?\" To which our brave superhero replied: I am " + fungalInfection + " Man!");

//Story credits:
//dip magazine, August 2002 issue

After completing this exercise, try making your own version, and ask your friends to fill in the variables.

<< PREV: Variable Naming Rules and Conventions - Introduction to Flash AS3 Variables - PART 2

Friday, November 25, 2011

Migrating custom fields from Drupal 6 - Data reporting and visualization in Drupal 7

Learn how to migrate custom fields from Drupal 6 to Drupal 7 in this video tutorial. This is from the Drupal 7: Reporting and Visualizing Data training course by lynda.com. Visit the course details page to learn more. Visitors of this site can also get a free 7-day trial pass for complete access to the entire lynda.com library of over 1000 courses.

Migrating custom fields from Drupal 6


Data reporting and visualization in Drupal 7 - Website Example

In this video, the author shows you an example of a yoga studio's website that uses Drupal 7 to report and visualize data. This is from the Drupal 7: Reporting and Visualizing Data training course by lynda.com. Visit the course details page to learn more. Visitors of this site can also get a free 7-day trial pass for complete access to the entire lynda.com library of over 1000 courses.



Sunday, November 20, 2011

Adobe Flash CS5 and ActionScript 3 Video Tutorials in French

Course: Tutorom Adobe Flash CS5 Nouveautés et ActionScript 3.0
Author: Rachel Thiebaud
Training Site: VTC Online University.

Below, you will find free sample videos to an Adobe Flash CS5 and ActionScript 3 training course in French. This course is provided by the VTC Online University. If you wish to view the entire course, learn more about the VTC Online University and sign-up for a membership.

Introduction

Présentation du tutorom
Nouveautés d'Adobe Flash CS5
Travail collaboratif : format de fichier .xfl

Créer du texte avec le nouvel outil TLF

Créer des paragraphes
Formater du texte
Créer des colonnes
Relier des blocs de texte entre les images

Dessiner et animer des décors avec l'outil Déco

Dessiner avec de nouveaux remplissages
Nouveau : dessiner des images animées

Animer avec un squelette

Utiliser les modèles d'animation Flash
Créer un squelette avec l'outil Segment
Créer un effet de ressort avec l'outil Segment

Les bases d'ActionScript 3.0

Introduction et nouveautés
Fenêtre Actions : panneaux et assistant de script
Fenêtre Actions : barre d'outils de code
Objets : classe et propriété
Objets : méthode et fonction
Variables
Expressions - Types de données
Syntaxe de code
Externaliser le code A.S

Coder avec les fragments de code AS 3.0

Créer un lien vers une page web
Créer un lien vers une animation
Contrôler l'animation avec des boutons Stop et Play
Déclencher une animation - Événements de souris (clic - survol…)
Déplacer un objet avec les flèches du clavier
Ajouter une action de glisser-déposer sur une image
Cliquer pour positionner un objet
Placer l'objet au premier plan
Faire disparaître une image en fondu
Cliquer pour masquer l'objet
Afficher un objet
Cliquer pour afficher un champ de texte
Personnaliser le curseur de la souris
Générer un numéro aléatoire
Afficher le temps - Compte à rebours

Animer avec les fragments de code AS 3.0

Animation de pixels en pixels
Animation fluide
Rotation
Copier un code d'animation

Les fragments de code AS 3.0 pour texte et images

Cliquer pour charger des images de la bibliothèque
Ajouter - Supprimer instances de la bibliothèque
Charger du texte externe

Créer un diaporama avec des boutons

Créer des boutons reliés à des images externes
Charger des images externes

Créer un menu déroulant

Créer un menu principal et des sous-menus
Créer un menu déroulant animé
Créer des boutons de menu
Fermer un menu déroulant

Utiliser les fragments de code AS 3.0 pour la vidéo

Introduction et nouveautés
Paramétrer le lecteur FLVPlayback
Extraire une image de la vidéo comme image de prévisualisation
Charger l'image de prévisualisation
Lancer la vidéo après la prévisualisation
Nouveau : insérer des points de repères directement dans Flash
Insérer des sous-titres
Lire plusieurs vidéos avec des boutons
Lire plusieurs vidéos avec une Playlist
Créer le code pour la Playlist

Conclusion

Résumé et aide
Présentation de l'auteur

Saturday, November 19, 2011

PART 2 - Variable Naming Rules and Conventions - Introduction to Flash AS3 Variables


Variable names are author-defined. This means that you, as the author of the Flash ActionScript 3.0 project, will decide which names to give your variables. But there are still some rules that you have to follow. In this part of the Introduction to Flash AS3 Variables tutorial series, we'll take a look at what those rules are. We'll also take a look at some commonly used naming conventions when it comes to working with variables.

Variable Naming Rules

Rule #1: Do not use any ActionScript 3.0 reserved words (also referred to as keywords) to name a variable.

Examples:
var var:Number;
var this:String;
var new:Boolean;

The examples above are unacceptable because var, this, and new are all ActionScript 3.0 reserved words.

Rule #2: Variable names must be unique.

The example below will generate an error message:
var myVariable:Number;
var myVariable:String;

Even if each variable is assigned a different data type, the names are the same. This will create a conflict between the two variables.

Rule #3: Variable names are case-sensitive

The following variables are considered two different variables:
var myVariable:Number;
var myvariable:Number;

In the examples above, one variable name has an uppercase V, while the other one has a lowercase v. Because of this, these two variables are considered entirely different from each other. They will not create a conflict. And it does not matter that they both have the same data type; they are still two separate variables.

Rule #4: Variable names can only use letters, numerical characters, the underscore, and the dollar sign.

The following example is unacceptable because it uses the @ sign in the variable name:
var myV@riable:String;

The underscore and the dollar sign are the only special characters that can be used when naming variables. No other special characters can be used.

Rule #5: A Variable name can only start with either a letter, an underscore or the dollar sign.

The following example is unacceptable:
var 1_variable:Number;

Although this variable name does not use any unacceptable characters, it does begin with a numerical character. Variable names can only begin with either a letter, an underscore or the dollar sign.

An acceptable version of the example above would be:
var variable_1:Number;

Here, since it does not use any unacceptable characters and it DOES NOT START with a numerical character, then the variable name is acceptable.

Rule #6: Variable names cannot contain spaces.

The following example is unacceptable because the variable name contains a space:
var my variable:Boolean;

Some Variable Naming Conventions

The following items are not rules used in naming variables, but are more of commonly-used practices and styles. You do not have to follow these suggestions, but they might help make your code more organized and easier to understand.

#1 Use variable names that are descriptive of the type of data they will hold or the purpose they will serve.

Instead of using generic variable names such as:
var string1:String = "John";
var string2:String = "Smith";
var number1:Number = 2012;

Consider using more descriptive alternatives:

var firstName:String = "John";
var lastName:String = "Smith";
var year:Number = 2012;

#2 If you want to combine different words in one variable name, you can differentiate these words by using uppercase and lowercase letters.

Instead of using:
var myvariable:Number;

Consider using:
var myVariable:Number;

This is a practice referred to as camel casing, because the visual bumps created by the uppercase letters are similar to the humps on a camel's back.

#3 You can prefix your variable names with a character that is descriptive of its data type, such as s for a String variable or n for a Number variable.

Examples:
var sTitle:String = "Learning ActionScript 3.0";
var nScore:Number = 99;
var bActive:Boolean = false;

This is a convention know as the Hungarian notation.

And that concludes this tutorial series on an Introduction to Flash ActionScript 3.0 Variables.

<<PREV: Creating ActionScript 3 Variables and Assigning Values to them - Introduction to Flash AS3 Variables - PART 1

PART 1 - Creating ActionScript 3 Variables and Assigning Values to them - Introduction to Flash AS3 Variables


Welcome to this tutorial series on an Introduction to Flash AS3 Variables. In part 1 of this series, we'll talk about what variables are, see some basic examples, and learn how to create them.

What is a variable?
Think of a variable as a container. It's like a box where you can put something in. But instead of a physical object, a variable can contain information.

A variable is made up of a name and a value. The name is like the label on the box, and the value is the item inside that box.

For example:
quantity = 12
price = 1.25

Here, we have two variables. The first variable has the name quantity, and has a value of 12. And then we have another one with the name price, and a value of 1.25.

We can then use these variables in an equation. For example:
quantity * price

In this equation, the quantity and price are being multiplied. This will give us a value of 15. Since quantity is equal to 12, and price is equal to 1.25, then 12 * 1.25 is equal to 15.

Creating Variables

Step 1

Create a new Flash ActionScript 3.0 document and type in the following lines of code in the Actions Panel:
var quantity:Number;
var price:Number;

In the first two lines, we've declared two variables - quantity and price. To declare a variable, start with the var keyword, followed by the variable name, and then the data type.

The syntax for declaring a variable is as follows:
var variableName:dataType;

What is the data type?
The data type refers to the type of value that a variable can contain. In the two examples, we've specified the Number data type. This means that the variables can only contain numbers. If you try to assign some text as the variable's value, then that will generate an error. Specifying the data type that a variable can contain is referred to as strict data typing or strong data typing.

What are other examples of data types?
Other examples of data types are the String data type and the Boolean data type. String data is made up of characters. The Boolean data type only chooses between 2 values - true or false.

Examples:
var firstName:String;
var isActive:Boolean;

Here, the firstName variable can only contain a String value such as "John" or "Mary" (String values must be enclosed in quotation marks). The isActive variable, on the other hand, can only be assigned a value of either true or false.

In the next step, let's take a look at how to assign values to our variables.

Step 2

To assign values to our variables, add the following lines highlighted in bold:
var quantity:Number;
var price:Number;

quantity = 12;
price = 1.25;

To assign a value to a variable, type the variable name, followed by the equals sign (also known as the assignment operator), and then input the desired value. Here, we have given quantity a value of 12, and price a value of 1.25.

The syntax for assigning a value to a variable is:
variableName = value;

When assigning a value to a variable, there is no need to use the var keyword again since we've already done that at the beginning. The var keyword is used to declare or create the variable. You only need to do that once. You also don't need to declare the data type again.

Step 3

If you want, you can also combine the variable declaration and the value assignment in one statement. Let's do that.

Delete the lines of code that we've already typed and replace them with this:
var quantity:Number = 12;
var price:Number = 1.25;

Here, each variable is declared and assigned a value in one statement. This is pretty much the same thing, except we have fewer lines of code.

Step 4

Next, add some trace statements to verify that Flash is able to access the values assigned to the variables:
var quantity:Number = 12;
var price:Number = 1.25;

trace("The quantity is: " + quantity);
trace("The price is: " + price);
trace("The total is: " + price * quantity);

Here, the trace statements will evaluate the variables and equations, and will display their values. For example, in the first trace statement, the variable name quantity will be displayed as 12, since 12 is the current value assigned to it. In the third trace statement, price * quantity will be calculated, and based on our current values, it will result in a value of 15.

Step 5

Test the movie. You should see the output window display the following lines:
The quantity is: 12
The price is: 1.25
The total is: 15

Step 6

After assigning an initial value to a variable, you may still assign a new value afterward. Let's try that.

After the trace statements, assign new values to the variables:
var quantity:Number = 12;
var price:Number = 1.25;

trace("The quantity is: " + quantity);
trace("The price is: " + price);
trace("The total is: " + price * quantity);

quantity = 5;
price = 2.75;

So now, after the trace statements are executed, the variables will have these new values assigned to them.

Step 7

To check whether the new values have been successfully assigned, let's add another set of trace statements after the lines that assign the new values to the variables:
var quantity:Number = 12;
var price:Number = 1.25;

trace("The quantity is: " + quantity);
trace("The price is: " + price);
trace("The total is: " + price * quantity);

quantity = 5;
price = 2.75;

trace("The values have been changed.");
trace("The new quantity is now: " + quantity);
trace("The new price is now: " + price);
trace("The new total is now: " + price * quantity);

Here, when the first set of trace statements are executed, Flash will be taking a look at the original values. But after that, the variable values have been changed, so the second set of trace statements, which comes after the new values, will now use those new values instead. The FIRST set of trace statements will use the ORIGINAL values, because those trace statements were written BEFORE the values were changed.

Step 8

Test the movie. You should see the output window display the following lines:
The quantity is: 12
The price is: 1.25
The total is: 15
The values have been changed.
The new quantity is now: 5
The new price is now: 2.75
The new total is now: 13.75

Step 9

You can also assign an equation to a variable. For example, we can get the price * quantity equation and store it in a variable like so:
var quantity:Number = 12;
var price:Number = 1.25;
var total:Number = price * quantity;

And then in the trace statements, we can replace all the instances of the price * quantity equation with the total variable instead:
trace("The quantity is: " + quantity);
trace("The price is: " + price);
trace("The total is: " + total);

quantity = 5;
price = 2.75;
total = price * quantity;
// You must compute for the total again in order to
// reflect the new value

trace("The values have been changed.");
trace("The new quantity is now: " + quantity);
trace("The new price is now: " + price);
trace("The new total is now: " + total);

This will give us the same result.

In the next part of this series, we'll take a look at the rules you have to follow when naming variables.

Friday, November 18, 2011

Learn how to make music on the iPad - Online Video Training Course

If you are interested in creating music with your iPad, let experienced engineer, author, composer, and educator Sam McGuire take you through eleven music production apps designed for the iPad in this iPad Music Production online training course. The Apps include notation software, audio / MIDI sequencers (including GarageBand), and a variety of musical instruments. This video training course is from the VTC Online University. Watch the first 3 chapters for free. Just click on the movie links below to start learning.

Introduction

The iPad as a Musical Instrument
Settings and Usage


Music Making

The Phases of Music Making
The iPad's Place in Your Workflow


Accessories and Options

MIDI
Audio I/O
Networking

Want to view the entire course?

Sunday, October 16, 2011

YouTube partner program now available in the Philippines

I have some good news for YouTube channel owners residing in the Philippines - the YouTube partner program is now officially available. If you are in the Philippines and you visit the YouTube partner page, you will now be able to access the application link. Users from countries not eligible to join the partner program will get redirected to the homepage when they try to access the partner page. That is no longer the case for users from the Philippines. Currently, there are around 20+ countries included in the partner program. Some of the countries included are Argentina, Sweden, New Zealand and the Czech Republic. Apply now!