Sunday, May 17, 2015

Arrays with Actionscript 3.0

An array is a list of items that can be used as variables. Rather than declare each variable separately, we do it all at once with an array. In this exercise we will experiment with a simple array to see how one works.

The Basics 

To begin, we'll create an array that contains a list of words. Then we'll use a button to retrieve one of those words from the list.

Creating text Dynamically (Flash AS3)

Putting text into a Flash movie is pretty simple—create a text box with the text tool, set the appropriate values for color, font, size, etc., and then specify if its dynamic, static or input text. To add text to a dynamic text box all you need to do is to place nameOfBox.text = "text to go in the box" in your code

Create a basic text box

Open a new Flash file and save it right away as createTextBox.fla

var myTextBox:TextField = new TextField();   
myTextBox.text = "Hello world!";   
addChild(myTextBox);

Friday, May 15, 2015

Create Masking in Flash

Hi, .
Masking is revealing portion of your picture or graphic in the layer below. While surfing through net you might have come across lots of beautiful Flash effects such as ripple effect, some wording with sky background or glitter bordering an object, and wondered "How? What is the logic behind this.

Let's follow :

Inserting Layers and Naming them

Basic of HitTestObject Actionscript 3.0

Hello blogger,  this time on the basis of using hitTest Object. HitTestObject script is a script to detect the collision of an incident in which two objects touch each other. For more details see the following script :

1. Make two objects with a movie clip instance name "mc_box" and "mc_oval".
2. Later in the frame 1 press F9 to activate the actionscript window.
3. Then type the following script:

ANSI ASCII code

As the discussion on Moving Objects With the keyboard, use the ASCII code is also required in determining the motion of the object. For example, a keyboard you choose to move the object to the left then the ASCII code used for A is 65. From where do we get the ASCII code? for more details you can see some of the ASCII code below :

Tag Quotation

tag <blockquate>, used to make the most of the quoted text as a block of its own. In general, a browser change the margins for text citations had to separate the surrounding text.

tag <q>, do not do anything special, but by defining as a quote, then used as a style sheet then these quotes can be arranged performatnya by using style sheets.

Break And Continue

Break

The break statement stops the loop immediately. Code in the loop body following the break statement is not executed. Break stops the loop over if the result of the conditional expression in your loop is true.

Example :
   for(var i:int=1; i<23; i+=4){
      if(i==13){
        break;
      }
      trace(i);
   } //output 1 5 9

Looping "For" in Actionscript 3.0 (Part 2)

This time the update statement increments the iteration variable by 5. The loop will stop once is no longer less than 20.
   for(var i:int=0; i<20; i+=5){
      trace(i);
   }
   //output 0 5 10 15

The for loop in the function below instantiates a new instance of a TextField duing each iteration. The iteration variable is used to set the x and y position of each instance. Because I changes each iteration, the x and y position will be different for each instance.

Make Horizontal Line and Comments

Make Lines Horizontal

A line can be inserted in a web document. is commonly used as a separator between sections or paragraphs.

<hr> tag will be inserted in a web document:
Examples of writing the tag <hr>:
<html>
<head><title> writing tag hr </title>
</head>
    <body>
      welcome to my website
      <hr>
    </body>
</html>

ActionScript 3 fundamental: Syntax

The syntax of a programming language is the set of rules you must follow when writing code. Syntax error are some of the most common errors made by developers, especially when they are first leaning a language. Typically, the compiler cant compile code that contains syntax errors. One thing to keep in mind - syntax does not provide information on the meaning behind the symbols or structure in your code.
In this article, you will learn the syntax of Actionscript 3.0 :
  
Actionscript 3.0 is a case-sensitive language. Identifiers that differ only in case are considered different indetifiers.
var exampleVariable:int;
var ExampleVariable:int;

Popular Posts

Categories

tutorial-nia. Powered by Blogger.