Facebook Digg Technorati Delicious

Design SwanDesign Swan

RSS

Super Funny – Animation about Chinese Dumpling

In Flash 6,201 views

An amazing Chinese Animator “sun haipeng” just made two animations about the Baozi ( a kind of Chinese dumpling), telling us how can Baozi hold concern and the fight between Baozi and sushi. The animations are super funny. Hope you enjoy it…

As author said

Super Baozi, being tired of being in Catering,is longing for developing in Recreation. With intense enthusiasm and strong perseverance, he has learned to sing songs and to play nunchakus.

1. Super Baozi vs Sushi man


Read the rest of this post »

AS3: When and Why use “final” attribute

In Flash 7,203 views

To prevent a class from being extended or a method from being overridden, we precede that class or method definition with the final attribute.

How it works?
To Final a class:
final public class A{

}

To Final a method:
public class A{
final public function A{

}

}

The final attribute is used for two reasons in ActionScript:

  • In some situations, final method execute faster than non-final methods. If you are looking to improve your application’s performance in every possible way, try making its method final.
  • Methods that are final help hide a class’s internal detail. Making a class or a method final prevents other programmers from extending the class or overriding the method for the purpose of examining the class’s internal structure. Such prevention is considered one of the ways to safeguard an application from being maliciously exploited.
  • AS3: Recursive Functions vs Loop Functions

    In Flash 11,448 views

    A recursive function is a function that calls itself. The following code shows a simple example of recursion.

    function trouble(){
    trouble();
    }

    A recursive function like above calls itself unconditionally, cause infinite recursion. To prevent this from happening, practical recursion functions call themselves only while a given condition is met.
    Read the rest of this post »

    AS 3: Functions as Values

    In Flash 2,416 views

    A function can be assigned to a variable, passed to a function, or returned from a function, just like any other values.

    For example, the following code defines a function, a() and then assigns it to the variable b. Notice that the parentheses operator, (), is omitted; if it were included, the code would simply assign a()’s return value to b.

    function a(){

    }
    var b=a;

    Once a function has been assigned to a variable, it can be invoked through that variable using the standard parentheses operator, (). For example, the following code invokes the function a() through the variable b:

    b();