Error in actionscript

Error in actionscript
Someone who is just learning action script or someone who advance in action script never apart from an error. In a programming there are 2 types of errors, that is typing errors and logical errors

Typing error in Action Script

The most frequently error made by someone who was just learning script is a typing error in the script. To find a typing error, flash provides check syntax facility on the action panel.

By pressing check syntax, we can know that script that we type is have an error or not.


Typing error will show in output panel. Scene, layer, and frame where we make error and which line we make error is showing in this panel, so it will help us to fix error.

Errors that often occur are :
  • Typing error of simple action, example : duplicateMovieClip typed to dupilcateMoviClip.
  • Use of space in write instance name or variable. Example: origin size = 5; should be written origin_size = 5;.
    Tips : Don’t often write script with space, because flash can arrange automatically if we press Auto Format.
  • Error when we use lowercase and uppercase. In common flash action script is not case sensitive (sensitive to lowercase and uppercase).But flash distinguish a text with different colors. When we write an action without regard to lowercase and uppercase letters, then the text turns black, while if it is true then the text will be colored dark blue. Text color distinction in the action script is as follows
    *
    Dark Blue is used in action color.
    *
    Light blue use as string color.
    *
    Gray use as comment color.
    *
    Black used in writing text beside 3 above
  • Error when use “{}”. Someone  who beginner in flash often confuse in using this. This symbol is action block, all action that inside “{}” is categorized in certain block like movie event, mouse event, function, if, for and many more. Amount of “{“ must same with amount of “}”.
    Tips : after we type “{“ immediately type “}”, then put cursor between this character then press enter or type the action inside.
  • Error when use “()”. In contrast with “{}”, character “()” is not state a block but usually represent part of typing action that used. Example if(){ }, trace(..);. Note that amount of “(“ must same with “)”.
  • Error when use “=” and “==”. Character “==” only used in conditional, but “=” used to set value of variable.
  • Error when use dot. In all programming language, dot character “.” is vital, so be aware using this character.

Logical Error in Action Script

Logical errors cannot be detected by check syntax button, because errors comes from the programmers. Logical errors is actually a mistake in develop and use action script,so can causing the program make slow, there are parts that should move but its not, consuming computer memory or often called as a bug, and others. To fix bug run first, then test the program as often as possible and look for opportunities that may occur as much as possible. When find the wrong section, go back into action and find which parts causing the error, then correct as possible.



Post a Comment

0 Comments

-------- MASUKAN KODE IKLAN 1 --------
-------- MASUKAN KODE IKLAN 2 --------
-------- MASUKAN KODE IKLAN 3 --------
To Top