프로그래밍/Flex/AIR2008.08.07 10:16
이미 컴파일러 옵션을 알고 계신 분들은
100만년 전에 알고 계셨을테지만 ^^;

전 오늘 첨 해봤네요-
그냥 내부적으로 그렇게 된다고만 알고 있었지.. 막상 직접 보니
감회가 새로워서 글로 정리합니다.

서두는 이 정도로 하고

[윈도우즈, 빌더 기준]
C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.1.1739\frameworks\flex-config.xml
C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.1.1739\frameworks\air-config.xml
파일을 열어 다음 구문을 찾습니다.

<!-- Turn on writing of generated/*.as files to disk. These files are generated by -->
<!-- the compiler during mxml translation and are helpful with understanding and   -->
<!-- debugging Flex applications.                                                  -->
<keep-generated-actionscript>false</keep-generated-actionscript>

flase 부분을 true로 바꿉니다.

다시 컴파일하고 나면
프로젝트 폴더의 src 하위에 "generated"라는 폴더가 생깁니다.
이제 그곳을 확인하시면
mxml이 as로 변환된 과정을 확인하실 수 있습니다.


사용자 삽입 이미지


참고:
http://kanuwadhwa.wordpress.com/2007/06/30/flex-tip-of-the-day-3-keep-generated-actionscript/

다른 방식으로 하기:
http://flextips.corank.com/tech/framed/keep-Generated-Actionscript
신고
Posted by 시난
TAG flex, TIP
프로그래밍/Flex/AIR2008.03.06 17:47

http://codeazur.com.br/lab/airremoteupdater/


일단 발견만 했습니다. 지금 해보려고 하는 중이고. ^^;

아마 잘 될 것 같습니다.

해보고 다시 댓글 추가하겠습니다 ^^;;

[추가] 결론은 잘 됩니다. 버전 설정 부분만 숫자랑 . 등으로 구성하시면 됩니다.


côdeazur brasil lab

AIR Remote Updater

The AIR Remote Updater is an Actionscript 3 class to automate remote software updates in Adobe AIR applications.

It transparently checks version numbers, downloads the .AIR installer file if needed and triggers the AIR-native update process. It grabs the version number directly from the remote .AIR file without having to download the entire file, eliminating the potential error prone need of having to put a separate descriptor file online along with the .AIR installer file.

Background

An .AIR installer file is a PKZIP archive containing metadata files along with the packaged application files. The files contained in a .AIR installer file are, in this order:

  • /mimetype
  • /META-INF/AIR/application.xml (contains version info)
  • /META-INF/AIR/hash
  • /META-INF/signatures.xml
  • packaged application files

The file we are interested in, /META-INF/AIR/application.xml (the "application descriptor file"), is always the second file in the archive. FZip is used to stream in the remote .AIR until (and only until) the application descriptor file has loaded. We can then close the stream, uncompress that file and extract the version number.

Usage

<PRE class=actionscript>public function update():void { var request:URLRequest = new URLRequest("http://domain.com/yourapplication.air"); var updater:AIRRemoteUpdater = new AIRRemoteUpdater(); updater.addEventListener(AIRRemoteUpdaterEvent.VERSION_CHECK, updaterVersionCheckHandler); updater.addEventListener(AIRRemoteUpdaterEvent.UPDATE, updaterUpdateHandler); updater.update(request);} protected function updaterVersionCheckHandler(event:AIRRemoteUpdaterEvent):void { // The AIRRemoteUpdaterEvent.VERSION_CHECK event is fired // as soon as both local and remote version numbers are known. var updater:AIRRemoteUpdater = event.target as AIRRemoteUpdater; trace("Local version: " + updater.localVersion); trace("Remote version: " + updater.remoteVersion); // You can stop execution of AIR Remote Updater at this point // by calling event.preventDefault(), for example to inform the user // that a new version is available and/or ask if she likes to download // and install it. When the user confirms, call AIRRemoteUpdater.update() // again with the versionCheck argument set to "false". This will // circumvent the version checking procedure and immediately // starts to download the remote .AIR installer file to a temporary // file on the user's harddisk.} protected function updaterUpdateHandler(event:AIRRemoteUpdaterEvent):void { // The AIRRemoteUpdaterEvent.UPDATE event is fired when // the remote .AIR installer file has finished downloading. // The event's "file" property contains a reference to the // temporary file on the user's harddisk. trace("Installer: " + event.file.nativePath); // You can stop execution of AIR Remote Updater at this point // by calling event.preventDefault(), for example to inform the user // that the application is about to shut down and update itself.}</PRE>

Download

AIR Remote Updater 1.0.003

History

AIR Remote Updater 1.0.003

  • Release for AIR 1.0.

AIR Remote Updater 1.0.002

  • Release for AIR Beta 2.

AIR Remote Updater 1.0.001

  • Initial Release.

License

AIR Remote Updater is released under the OSI approved zlib/libpng license.

Author

Claus Wahlers



신고
Posted by 시난
TAG AIR, TIP
프로그래밍/Flex/AIR2007.01.09 11:57

xml 을 접근하여 사용함에 있어서 초보적인 간단한 팁을 나누고저.. ^^;


var xml:XML =

<root>

   <a>aaa</a>

   <b>bbb</b>

    <c id="cid" />

     <d>

         <dChild>dchild</dChild>

      </d>

     <e>

       <child>1</child>

       <child>2</child>

       <child>3</child>

     </e>

</root>;



가 있다고 할 때


1.

xml["a"] 하게 되면

xml의 root 아래 있는 <a>aaa</a> 를 XMLList 형태로 사용할 수 있습니다.


2. xml.c.@id 하면 attribute를 e4x 식으로 접근해서 쓸 수 있습니다.


3. xml.descendants("a") 하시면 1번보다 더 넓게.. 하위 모든 노드들을 검색하여 <a>를 XMLList로 구성하여 쓸 수 있습니다.


4. xml["d"]["dChild"] 하시면 또한 XMLList 형태로 가져다 쓸 수 있습니다.


5. trace( xml["없는노드"] ) 하시면  ""이 나옵니다.

xml["없는노드"]["없는노드"] 하셔도 "" 이 나옵니다. (에러 발생없음)


6. XMLList 형태는 xml["e"]["child"][0] 형태로 접근하여 사용하실 수 있습니다.



참고:

E4X
The ECMAScript for XML (E4X) specification defines a set of classes and functionality for working with XML data. E4X makes it easy to utilize XML structured data and reduce code complexity as well as create less coupling between code and external data.

Key features of E4X include:
ECMAScript for XML specification defines a new set of classes and functionality for working with XML data.
You manipulate XML data with well-known operators, such as the dot (.) operator.
Use the @ and (.) operators not only to read data, but also to assign data.
Using E4X functionality is much easier and more intuitive than "walking the DOM".
E4X Example:
An example application is available here ( http://www.trilemetry.com/clients/f3gse/partIII/partIIIa/workingWithData_e4x.cfm )


신고
Posted by 시난
TAG e4x, TIP, xml