[카테고리:] Flash

  • Saving an image with AS3 and PHP: 1. PHP

    The following PHP code is the code to save an image, which is uploaded using FileReference or is encoded using ByteArray in a Flash movie. The uploadok.php file can handle all the files, uploaded using FileReference, ByteArray or a file form in an HTML document.
    다음 코드는 플래시에서 FileReference를 사용한 업로드 또는 ByteArray로 인코딩된 파일을 저장하기 위한 PHP 코드입니다. 이 uploadok.php 파일 하나로 플래시의 FileReference, ByteArray는 물론 HTML문서의 파일 양식을 통한 업로드도 모두 처리가 가능합니다.
    Sorry, Japanese translation is not yet available.
    Special thanks to Kim Eung. He devised the draft of the PHP and AS3 codes. Furthermore, he allowed me to open them to the public.
    이 PHP와 AS3 코드의 기틀을 만들고, 이 소스를 공개하는데 흔쾌히 동의하신, 김응 실장님에게 진심으로 감사드립니다.
  • AddedToStage event object and root, parent.

    In AS3, There are times that you can not use root or parent properties on a display object. It is because root and parent properties are set to null, unless they are not added to the stage. So, an error occurs when you try to use root or parent properties in the constructor of an class. To avoid this problem, use addedToStage event object, and run codes after a display object was added to the display list.
    AS3의 디스플레이 오브젝트에서 root 또는 parent 속성을 참조하지 못하는 경우가 종종 있습니다. 이는 root 및 parent 속성은 디스플레이 오브젝트가 스테이지에 애드되지 않으면 null 값을 가지기 때문입니다. 그러므로 클래스 컨스트럭터에서 root 또는 parent를 참조하려 할 때 에러가 발생하는 것입니다. 이를 해결하기 위해서 addedToStage 이벤트 오브젝트를 사용하여, 디스플레이 오브젝트가 디스플레이 리스트에 추가되었을 때 필요한 코드를 실행하도록 하면 됩니다.
    AS3で、ディスプレーオブジェクトがrootやparentプロパ ティを参照できない時があります。それは、ディスプレーオブジェクトがステ―ジに追加されていないと、rootとparentプロパ ティはnullに設定されると言うわけです。だから、クラスのコンストラクタの中でrootやparentプロパ ティ参照しようとする時、エラーが発生するのです。このエラーを回避するために、addedToStageイベントオブジェクトを使用し、ディスプレーオブジェクトがディスプレーリストに追加された時、コードを実行します。

    root property
    root:DisplayObject [read-only]

    …… The root property is set to null for any display object that has not been added to the display list, unless it has been added to a display object container that is off the display list but that is a child of the top-most display object in a loaded SWF file.

    quote from ActionScript 3.0 Language and Components Reference

    The following codes are the codes that I use frequently. I choose _root and _parent keywords that are not used in AS3.
    다음 코드는 제가 자주 사용하는 코드로, AS3에서는 사용되지 않는 _root, _parent 키워드를 사용합니다.
    下のコードは私がよく使うこーどで、私はAS3では使わない_rootと_parentキーワードを選びました。
    package{
    	
    	import	flash.display.MovieClip;
    	import	flash.events.Event;// added on 2011.03.24
    	
    	public class SomeClass extends MovieClip{
    		
    		private var _root:MovieClip;
    		private var _parent:MovieClip;
    		
    		public function SomeClass(){
    			
    			addEventListener(Event.ADDED_TO_STAGE, initialize);
    			
    		}// end SomeClass constructor
    		
    		
    		/**
    		 * Initializes the SomeClass, when an instance is added to the display list
    		 */
    		private function initialize(evt:Event):void{
    			
    			removeEventListener(Event.ADDED_TO_STAGE, initialize);
    			
    			_root = root as MovieClip;
    			_parent = parent as MovieClip;
    			
    		}// end initialize
    		
    	}// end SomeClass definition
    	
    }// end package
  • Flash CS3 Professional updated (9.0.2)

    Flash CS3 Professional was updated on December 12th. This update includes Flash Player 9 Update 3 support, video playback component with H.264 surpport, Flash Lite 3 update, and so on.

    Usually, it took some time to release Korean version after English one has been released. But, this update was delivered with all other language versions.

    12월 12일 플래시 CS3 프로페셔널이 업데이트 되었네요. 이번 업데이트는 Flash Player 9 Update 3 지원, H.264를 지원하는 비디오 플레이백 컴포넌트, 플래시 라이트 3 업데이트 등을 포함하고 있습니다.

    보통 영어버전이 공개되고, 시간이 지나서 일어 등 주요 언어와, 마지막에야 한글버전이 공개되던 것과 달리, 이번에는 모든 언어 버전들이 같이 배포되고 있네요.

    12月12日、Flash CS3 Professionalがアップデートされました。このアップデートは Flash Player 9 Update 3の支援、H.264を支援する video playback component、Flash Lite 3 アップデートなどを含んでいるんです。

    これまでは、英語のバージョンが発表されてから少なくない時間が過ごした後、韓国語のバージョンが公開されたけど、今度は他の言語のバージョンを一緒に配れているんですね。

    Adobe Flash Support Center – Adobe Flash Player Update for Flash CS3 Professional (9.0.2)

  • tweener

    Yesterday, jin_u told me about Tweener. Tweener is an open source(MIT License) library for tweening in ActionScript 2 and 3. It has more features than the Flash native Tween class.

    For more informaton, visit the official website at Google Code and Tweener Documentation and Language Reference.

    어제 사내 스터디에서 진우가 Tweener에 대해서 알려주었습니다. Tweener는 액션스크립트 2와 3에서 트위닝을 위한 오픈소스(MIT 라이센스) 라이브러리입니다. 플래시 내장 Tween 클래스보다 많은 기능을 가지고 있네요.

    자세한 정보는 Google Code의 공식 홈페이지와 Tweener 도움말을 참고하세요.

    昨日jin_uからTweenerについて聴いた。Tweenerはオープンソース(MIT License)ライブラリーとしてtweening機能を提供します。このクラスはフラッシュ内蔵クラスより機能が多いんです。

    詳しい情報はGoogle Codeの公式ホームページ、またはTweenerマニュアルへ…

  • addFrameScript: undocumented method

    You can add ActionScript codes to a specific frame using MovieClip.addFrameScript() method. The method is not documented, like setTimeout in the earlier version. And, mind that the frame numbering is zero-based.
    특정 프레임에서 다른 프레임에 액션스크립트를 지정할 수 있는 메소드가 있었네요. MovieClip.addFrameScript()가 바로 이런 기능을 하는 메소드인데, 액션스크립트 도움말에는 포함되어 있지 않은, 미공개 메소드입니다 (이전 버전의 setTimeout 처럼 말이죠). 단, 프레임 번호는 0부터 시작한다는 것만 주의하면 됩니다.
    特定フレームにActionScriptコードを追加出来るメソッドが在ったんですね。それはMovieClip.addFrameScript()です。このメソッドはヘルプには記載されていません。(以前バーゾンのsetIntervalのように…)。ただ、フレーム番号は0から始まるんですよ。
    stop();
    
    function frameEvent():void{
    	 tf.text = "This textfield is on frame 2.";
    }
    addFrameScript(1, frameEvent);
    
    gotoAndStop(2);

    Download addFrameScript.fla

    via FlashGuru Consulting