DClick

Arquivos da categoria "ActionScript"

Logic Operator ||= in AS3

Categorias relacionadas: ActionScript, Flex, Otimização, Programação
Twitter!

Well, few people knows about the logic operator “||=”. I’ll try to explain a little more about it.

In the adobe documentation, this operator is described like: “Assigns expression1 the value of expression1 || expression2″. Just to remember, the sintaxe to logic operator is “expression1 operator expression2“.

I’ll show some examples of how it works.
Leia o artigo completo »

Por Bruno Sales em 28/August/2009
Nenhum Comentário »


Other Languages:

Variable Scope in ActionScrip 3

Categorias relacionadas: ActionScript, Flex, Programação
Twitter!

Do you know what happens in the follow code?

ACTIONSCRIPT:
  1. var test:Boolean = false;
  2. if(test)
  3. {
  4.     var name:String;
  5. }
  6. else
  7. {
  8.     name = "Bruno Sales";
  9. }
  10. trace("Name: " + name);

Compile error? Runtime Error? Nothing. The trace result is "Name: Bruno Sales". The variable was created even if the code inside the IF was never executed.
Thats happens because ActionScript has just 2 types of scope: Global and Local; remembering that Local is everything inside a function.

However, I suggest never using something like this in your development process. Your code logic will be very confusing and will cause problem to maintenance and debug.

Por Bruno Sales em 25/July/2009
Nenhum Comentário »


Other Languages:

Carousel 3D with Flash Player 10

Categorias relacionadas: ActionScript, Flex, Flex Components
Twitter!

Some time ago, I wrote a small introduction about 3D effects from Flash Player 10. Moving on with my studies and understanding better how FP10 works, I did this component that, even being commun to 3D framework users, works good as native and consequently low weight.

The component can receive any DisplayObject, letting the interactivity works fine.

The follow demo shows the component and some of its properties:

You can see here the source code.
(Don't forget it is a FP10 project. To make it works go to Project Properties > Flex compiler > Require Flash Player and fill with 10.0.0).

Por Bruno Sales em 4/March/2009
Nenhum Comentário »


Other Languages: