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”);
?>