actionscript 에 해당하는 글2 개
2006/08/30   Classes in As and Java or C++
2006/05/26   Action 초기화 순서

flash/As3.0 | 2006/08/30 17:37
Programmers familiar with object-oriented programming (OOP) in Java or C++ may think of
objects as modules that contain two kinds of members: data stored in member variables or
properties, and behavior accessible through methods. The ECMAScript edition 4 draft, the
standard upon which ActionScript 3.0 is based, defines objects in a similar but slightly
different way. In the ECMAScript draft, objects are simply collections of properties. These
properties are containers that can hold not only data, but also functions or other objects. If a function is attached to an object in this way, it is called a method.
While the ECMAScript draft definition may seem a little odd to programmers with a Java or C++ background, in practice, defining object types with ActionScript 3.0 classes is very similar to the way classes are defined in Java or C++. The distinction between the two definitions of object is important when discussing the ActionScript object model and other advanced topics, but in most other situations the term properties means class member variables as opposed to methods. The Flex 2 Language Reference, for example, uses the term properties to mean variables or getter-setter properties. It uses the term methods to mean functions that arepart of a class.
One subtle difference between classes in ActionScript and classes in Java or C++ is that in ActionScript, classes are not just abstract entities. ActionScript classes are represented by class objects that store the class’s properties and methods. This allows for techniques that may seem alien to Java and C++ programmers, such as including statements or executable code at the top level of a class or package.
Another difference between ActionScript classes and Java or C++ classes is that every ActionScript class has something called a prototype object. In previous versions of ActionScript, prototype objects, linked together into prototype chains, served collectively as the foundation of the entire class inheritance hierarchy. In ActionScript 3.0, however, prototype objects play only a small role in the inheritance system. The prototype object can still be useful, however, as an alternative to static properties and methods if you want to share a property and its value among all the instances of a class.
In the past, advanced ActionScript programmers could directly manipulate the prototype
chain with special built-in language elements. Now that the language provides a more mature
implementation of a class-based programming interface, many of these special language
elements, such as __proto__ and __resolve, are no longer part of the language. Moreover,
optimizations of the internal inheritance mechanism that provide significant Flash Player
performance improvements preclude direct access to the inheritance mechanism.

<Flex 2 language Reference 36 page>

actionscript 와 java or c++ 의 class 간의 개념이 약간 다르다.
어찌보면 다아나믹한 움직임을 구현하기 위해선 필요한 차이점인지 모른다.
그래도 ECMAScript 기반의 언어라 그런지 java 와는 외향이 거의 흡사해진다는 느낌이다.
prototype 은 뭔가 꺼림직해서 이전부터 건드리지 않은 부분이지만 아니나 다를까 성능에 문제가 있을 수 있다고 하니 protoype object 는 터치하지 말아야 겠다...

 
 
태그 : actionscript, Class, java
이 글의 관련글(트랙백) 주소 :: http://kimkijeung.com/trackback/55

Name 
Password 
Homepage 
  secret
Comment 
  글쓰기

flash/Tip | 2006/05/26 18:22

Timeline --> MovieClip

항상 기억하자 하면서도 어느순간 잊어버려 엄청난 고생을 한다.
액션 초기화 순서는 타임라인이 무비클립보다 항상 먼저 일어난다.
따라서 타임라인의 액션과 같은 프레임상에 무비클립이 있을경우 그 무비클립을 제어하려고 하면
영 말을 듣지 않는다.
이것은 타임라인이 초기화될때 제어하려고하는 무비클립이 아직 초기화되지 않기 때문에 발생하는 문제이다.

해결방안
1. 타임라인의 액션의 위치를 제어하려고하는 무비클립의 위치보다 항상 뒤프레임에 위치하도록 함
2. 일정시간 딜레이후 타임라인 상의 액션을 실행한다


 
 
태그 : actionscript, flash, Tip
이 글의 관련글(트랙백) 주소 :: http://kimkijeung.com/trackback/22

Name 
Password 
Homepage 
  secret
Comment 
  글쓰기


[PREV] [1] [NEXT]

 
전체 (105)
flash (74)
math&physics (4)
programming (11)
Flex2 (1)
Mac (2)
photo (0)
project (6)
주저리주저리 (3)
유용한 자료들 (1)
diary (0)
Book (1)
web (2)
«   2009/01   »
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31