Kamis, 21 Mei 2015

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 :

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

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:

Text formatting

Okay, what about things like text colors, size, and even the font? Formatting options are handled by a separate Flash class, the TextFormat class. To use it we need to create an instance of the class, and then apply to to the text in our text box.

First we create an instance of the class :

    var myFormat:TextFormat = new TextFormat(); 

Now let's add some formatting:

    myFormat.color = 0xAA0000;  
    myFormat.size = 24;  
    myFormat.italic = true;   
    myFormat.align = TextFormatAlign.CENTER 

Load Swf With Actionscript 3.0

This time I will discuss about the Load swf With Actionscript 3.0 :

1. Create a new document.
2. In the first frame, press F9 to display the action frame.
3. And type the following script fragment :

    function loadSWF(){
         var url : URLRequest = new URLRequest(“movie.swf”);
         var loader : Loader = new Loader ();
         loader.load(url);
         addChild(loader);
    }