Monthly Archive for May, 2006

Limits of flash

Flash has some limits, very handy to know:

DOCUMENT

size:

-width: 1 to 2880

-height: 1 to 2880

drawing extents within:

-width: -720 to document width + 720

-height: -720 to document height + 720

-grid spacing: 7.2 to 288

-frame rate: .01 to 120

-frames: 16000

-layers: 16000

-movieclip instances: 16000

-loaded movies (in levels): 16000

MOVIECLIP

drawing extents within:

-width: -720 to 720

-height: -720 to 720 (1440×1440)

-_xscale/_yscale values: ~ 3276800

-_alpha values: 256

-_alpha steps: ~ .4 (don’t increment _alpha below that value)

-_x/_y steps: .05 (don’t increment _x/_y below that value)

-_rotation: -180 to 180 (you can set it to values beyond these but will revert to a value in that range)

-_rotation steps: .1 (_rotation wont be seen in increments below that value)

-attached clips before drastic attachMovie speed drop: ~ 800-1000 (common in grid creation; creating new clips to attach groups of clips, like each row, to will reduce the slowdown)

TEXT

-characters in a textfield: ~63000 (?)

-rotation of dynamic or input textfields w/o embedded fonts or static w/ device fonts: 0 (no rotation)

-max size of POST data (loadVars and XML Objects etc): around 64k

-characters for URLs set in Character panel: 127

SCRIPTING

depths:

-depths of existence: -16384 to 2130690045

(createEmptyMovieClip can surpass these values in creation but not always accurate

max reliable: 2147483647, min reliable: -2147483648)

-removable depths: 0 to 1048575

-recursive function call levels: 256

-loop calls: 400000 (?)

MISC

-Flash Player zoom: 2000%

-line thickness (Flash authoring): .1 to 10

-line thickness (AS): 0 to 256 (increments of 1; 0 is hairline)

-size of imported bitmap: 5×5 minimum

-shape hints: 0 to 26

Action 초기화 순서

Timeline –> MovieClip

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

이것은 타임라인이 초기화될때 제어하려고하는 무비클립이 아직 초기화되지 않기 때문에 발생하는 문제이다.

해결방안

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


java에서 리소스 사용의 균형

C++과 달리 자바에서는 게으른 방식의 자동 객체 삭제를 사용한다. 참조가 없는 객체들은 가비지 콜랙션(garbage collection)의 후보가 되며, 만약 가비지 콜랙션이 그 객체들을 지우려고 하기만 한다면, 객체의 finalize 메서드가 호출될 것이다.

더이상 대부분 메모리 누수 책임을 지지 않게 되어 개발자에게는 아주 편해진 일이지만, C++방식대로 자원을 청소하도록 구현하기는 어려워졌다.

다행스럽게도 사려깊은 자바 언어의 설계자들은 이것을 보상하기 위한 기능 하나를 추가해두었다.

finally 절이 그것이다. try 블록에 finally절이 들어있다면, 그절안의 코드들은 try 블록 안의 코드가 한문장이라도 실행되면 반드시 실행되도록 되어있다. 예외가 던져지더라도 상관없다.

finally 절 안의 코드는 반드시 실행된다. 이말은 다음과 같은 코드로 리소스 사용의 균형을 잡을 수 있다는 뜻이다.

public void dosomething() throws IOException{
 
       File tmpFile = new File(tmpFileName);
       FileWriter tmp = new FileWriter(tmpFile);
 
       try{
               //실행코드
       }
       finally{
               tmpFile.delete();
       }
}

이 루틴에서 사용한 임시파일은 루틴에서 어떻게 나가든 지워야 한다.
finally 블록이 이렇게 간결하게 해결해 준다.

Alcon – ActionScript Logging Console

Alcon is a lightweight external output console for Flash ActionScript that allows developers to view debugging information without relying on the Flash IDE. SWF files can be debugged and monitored no matter if they are in the web browser, Flash Player or a standalone executable. While that Alcon tries to keep inclusion into projects as simple as possible. In fact all that needs to be done is importing the Debug class into a project and you are ready to send debug information to the console with a simple Debug.trace() command.

Included into a project Alcon keeps a small footprint and takes less than a Kilobyte of filesize while still offering some other helpful features.

Please note: Alcon is now hosted at the Flash Game Programming Wiki (fgpwiki.corewatch.net/wiki/alcon)! New versions are downloadable from there

다운로드하기

정말 이전부터 꼭 필요했던 건데…특히 다른 곳과 함께 작업할 시에 강력한 힘을 발휘할듯..
간단한 디버거를 만들어 쓰긴했지만 원하는 log level 수준까지 걸러서 다른 색으로 가독성 높게 표현해준다..

이젠 웹브라우저에서도 디버깅이 가능할듯 싶다…

alcon

PHP redirection

1. 먼저 메타테그를 이용한 방법

<?
echo “<meta http-equiv=’refresh’ content=’0; url=http://kimkijeung.com’>”;
?>

현재 가장 많이들 쓰고 있는 방법이고 url 다음에 해당 경로를 넣어주면 되고 절대경로 상대경로에 관계없으며 또한 파라미터의 전달 등도 가능하다.
시간설정(초단위)을  하면 원하는 시간동안 딜레이도 가능

2. 자바스크립트를 이용한 방법

<?
echo “<script> document.location.href=http://kimkijeung.com’;
</script>”;
?>

. 또 다른 방법
<?
echo “<script>

window.location.replace(http://kimkijeung.com’);
</script>”;

?>

변수전달가능하고 상대경로도 가능합니다. 딜레이는 자바스크립트를 이용하면 가능

3. 헤더를 이용한 방법
<?
header(“Location: http://kimkijeung.com”);
?>

New – Adobe Apollo

Adobe [Macromedia] is working on a new product codenamed Adobe Apollo that integrates the Macromedia Flash Player with the Adobe Acrobat PDF Reader. Adobe Apollo software will provide Macromedia Flash and HTML functionality and will run independent from the web browser.

Apollo will offer data synchronization, the ability to work online or offline, one-click installation and desktop integration. Apollo will join Flash Lite (the mobile client) and Flash Player (the browser client) to form the Flash Platform client family.

Adobe Apollo is seen as the next generation Flash player that run out of the browser and offers Macromedia Central client like capabilities. Meanwhile, Adobe will continue to deliver the standalone version Flash Player and Adobe Reader for viewing and interacting with PDF documents and forms.

To explain the potential of Apollo, Macromedia Senior Vice President Mike Sundermeyer presented a concept application where a user’s entertainment library was fully indexed and integrated with ecommerce, email, messaging, media center and other dynamic content into one intuitive application.

Adobe Apollo sounds quite like Macromedia Central, a application and deployment environment. Macromedia Central applications are written in Flash and can be run locally on the user desktop from a Macromedia Central shell client.

Kevin Lynch said that Adobe Apollo will be posted on Macromedia (Adobe) Labs when it moves to alpha stage. It is now very clear that the Macromedia Flash Platform is not going to stay exclusively in web browsers.

Macromedia Flash Platform Architecture with Apollo Kevin Lynch announcing Apollo at Max 2005
Macromedia 가 Adobe 에 인수되고 나서 점점더 미디어 통합 정책이 일어나는것 같다.

플래시 내에서 pdf 파일을 볼수 있거나 html 태그가 완벽하게 지원되거나….등등…앞으로 엄청난 변화들이 예상되지만 한편으로 이많은 새로운 것들을 내 머리통 속에 넣어야 한다는 생각을 하면….기술은 사람을 기다려주지 않는것 같다.

Demeter 함수 법칙

디미터 함수 법칙은 프로그램에서 모듈간 결합도를 최소화하려 시도한다.

이법칙은 한 객체가 제공하는 메서드에 접근하기 위해 또 다른 객체들을 통하는 것을 허용하지 않는다.

디미터 함수 법칙 – 모든 메서드는 다음에 해당하는 메서드만을 호출해야 한다.

class Demeter {
private :
A *a;
Int func();
public :
//...
void example(B&  b);
}
void Demeter :: example(B& b){
C c;
Int f= func();  //----------- 자신
b.invert(); //--------------메서드로 넘어온 인자
a= new A();
a->setActive(); //---------자신이 생성한 객체
c.print(); //---------------직접 포함하고 있는 객체
}

참고 디미터 프로젝트 – 적응적 프로그래밍(Adaptive programming) 을 이용해서 소프트웨어를 유지보수하기 쉽고 진화하기도 쉽게 만드는데 초점을 두는 연구

Global Security Settings panel

플래시 8의 로컬 보안 변경사항에 따라 로컬상의 테스트를 html 상에서 하려면

경고창이 떠서 아주 성가셨다.

전역보안설정패널에서 c 드라이브 통채로 설정해 놓으면 된다.

전역 보안 설정 패널 가기

When should you do code refactoring ?

내 주변을 둘러보니 변화와 쇠퇴뿐…

-라이트HF.Lyte, “함께하소서 Abide with me”

코드가 더 이상 잘 맞지 않아서 장애물에 부딪쳤을때. 사실은 하나로 합쳐져 있어야 할 두개를 발견했을때, 어떤 것이든 ‘잘못’되었다고 생각될때, 그것을 변경하는 일을 주저하면 안된다. 언제나 바로 지금이 최적기다.

. 중복 DRY(don’t repeat youself) 원칙의 위반을 발견했을시

. 직교성이 좋지 않은 설계

코드를 리택토링(refactoring) 하는 것- 기능을 이리저리 옮기고 이전에 내린 결정을 갱신하는 것-은 사실 고통관리(pain management)를 실천하는 것이다.

현실을 피하지 말자. 소스코드를 이곳저곳 변경하는 것은 굉장히 고통스러운 작업일수도 있다.

거의 작동하는 수준까지 올려놓은 코드였는데 이제 완전히 망가져 버린다.

일찍 리팩토링하고, 자주 리팩토링 하자….


- The Programatic Programer 中 -

Image smoothing

플래시 8로 버전업이 되면서도 이미지 스케일 변경이나 회전시 안타깝게도 이미지 지글거림 현상 버그는 없어지지 않았다.
갤러리 사이트를 만들면서 이상한 현상을 하나 발견했는데 이 문제를 해결하는 방법은 fla 파일 최상의 루트에 한개의 프레임만 존재하면된다는 것이다..
기술적으로 이유는 설명할수는 없지만 이것을 염두에 두면 프로젝트 막판에 이유없이 이미지 울렁증이 일어나 스트레스 받는 일이 없을듯하다.

까먹으면 안되는데….반드시 상기!!!!!!타임라인에 넣었을때

타임라인에 직접 넣었을때                     프레임 한개에 넣었을때