여기(http://www.adobe.com/devnet/fireworks/articles/creating_panels_pt2_02.html)문서를 잠깐 참고했다.
여기 포럼(http://www.fireworksguruforum.com/)내용도 참고했다.
1. 액션스크립트 3.0 fla를 생성
2. 캔바스 크기 320x240.
3. Window->Components(Ctrl+F7)
4.
TextArea를 캔바스에 삽입
5. swf로 출력해서 C:\Program Files\Adobe\Adobe Fireworks
CS3\Configuration\Command Panels 에 넣음
(ex: first.swf)
6. fireworks 재시작 후 Window 메뉴를 보면 당당히 first가 이름을 올린 것을 볼 수 있다.
그리고 기능이 없어서인지 엄청나게 잘 동작한다.
일반적인 기능은 history에서 복사(링크 참고)를 하는 것만으로 엄청나게 쉽게 넣을 수 있다.
이제 내가 만드려던 기능을 만들어 보자.
패널 이름 : Selection Style(CSS)
용도 : 페이지 내에서 선택한 항목의 위치를 CSS로 변환(?)해준다.
제작 동기 : 이미지 잘라서 absolute 포지셔닝으로 넣은 다음 w/h/x/y 값 보고 width/height/top/left 적어주는 게 일이라서...
난점 : 플래시 제작 이번이 첨이다.
아까 그 파일 불러내 보자.
1. properties에서 instance name을 적어준다. - cssText
2. frame(즉 바탕화면) 선택 뒤 Actios로 들어감
test용. as3
import flash.external.ExternalInterface;
function selectObject(){
MMExecute('alert("Opening Document");');
}
ExternalInterface.addCallback("onFwDocumentOpen",selectObject);
as2
function onFwActiveSelectionChange(){
MMExecute('alert("WOW!!");');
}
이제 실전
as2
function onFwActiveSelectionChange(){
var selectionWidth = MMExecute('fw.selection[0].width;');
var selectionHeight = MMExecute('fw.selection[0].height;');
var selectionTop = MMExecute('fw.selection[0].top;');
var selectionLeft = MMExecute('fw.selection[0].left;');
cssText.text = '{\n'
+'\ttop:'+selectionTop+';\n'
+'\tleft:'+selectionLeft+';\n'
+'\twidth:'+selectionWidth+';\n'
+'\theight:'+selectionHeight+';\n'
+'}';
}
fireworks 8 api(http://livedocs.adobe.com/fireworks/8/fwextending/wwhelp/wwhimpl/js/html/wwhelp.htm)