How to extract Flex 1.5 MXML controls ActionScript source code
Sometime is very useful to have control implementation source code at hand. This article describe how to retrieve it. One of possible solutions is to see the source code under Flex Builder debugger.
Let's look at mx_debug.swc file (in my case the path is "C:\Program Files\Macromedia\Flex\lib\frameworks_debug\mx_debug.swc"). SWC is Flash component file, seems like internally it is plain ZIP archive (starts with magic PK and understandable by ZIP extractors). After unzipping mx_debug.swc content we will find "Library.swd" file inside. SWD files are debugging files containing necessary code information. Probably (?) Flex Builder debugger uses this information to provide control source code during debugging process.
Open "Library.swd" file content in plain text or binary editor, e.g. in Notepad, you'll see our controls source code inside. Unfortunately I didn't find SWD files extractor, so created simple one (swd.zip). It's chunky but works fine at least with "Library.swd".
- Copy "swd.js" file to certain directory on your PC, (e.g. C:\Temp).
- Copy "Library.swd" file to the same folder.
- Open command-line prompt and set appropriate current directory, (in our case it's C:\Temp).
- Execute the following command-line
C:\Temp>cscript swd.js Libary.swd
-
Wait for few minutes (of course C++/C# or Java implementation will make this in seconds, but perfomance is not the key in this case). As result it will create 452 files under C:\Temp folder.
Other interesting places to see source code
- "C:\Documents and Settings\<User>\Application Data\Macromedia\Flex Builder 1.5\Configuration\Objects\MXML\WEB-INF\flex\"
- "C:\Documents and Settings\<User>\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes\"
- "C:\Program Files\Macromedia\Flash MX 2004\en\First Run\Classes\"
- "C:\Program Files\Macromedia\Flex\lib\system_classes\"
- "C:\Program Files\Macromedia\Flex\lib\frameworks\mx.swc"
- "C:\Program Files\Macromedia\Flex\lib\frameworks_debug\mx_debug.swc"
- "C:\Program Files\Macromedia\Flex\resources\flexforflash\FlexforFlash.zip"
- "C:\Program Files\Macromedia\Flex Builder 1.5\Configuration\Objects\MXML\WEB-INF\flex\system_classes\"
Debugger friends
Related products
- Macromedia Flex 1.5
- Macromedia Flex Builder 1.5
- Macromedia Flash MX Professional 2004
Downloads
- SWD source code extractor - swd.zip (1,2 KB)
Flex 2 source code
How to extract Flex 2 source code? Now only Flex 2 Beta 2 released. There is rumor that with final Flex 2 release Adobe will publish source code for some MXML components, probably it will be around framework.swc, and possible chart.swc libraries, but I don't know, it's just my assumption.
There are also amusing packages like "playerglobal.swc" (player runtime), "enterprise.swc" (FES - mx.data.* packages), "rpc.swc" (remoting stuff, mx.messaging.*, mx.rpc.*), "automation.swc" etc. Probably "playerglobal", "enterprise" or "rpc" packages source code will not be published at all for security, money or other reasons.
Good news is that it's possible (after some spelunking with Flex Builder binaries) extract ABC (ActionScript byte code???) code for all components described in these libraries and then extract disassembled IL code. Not all classes are disassembled at this moment on my side. Also there is no AS3 decompiler (to create pure AS code). Nevertheless disassembled information is very useful and helps me to understand Flex 2 platform. Also I am not going to publish this tools and techniques at all. Probably it's question of time and someone else will create SWF decompiler tool for new Flash platform. Thanks. Vadim.
转自:http://blog.csai.cn/user1/265/archives/2007/14491.html
分享到:
相关推荐
flex入门教程,主要介绍了mxml和ActionScript的简单应用,适合初学者,高手就没必要下载啦
flex -MXML语法,介绍flex 的 mxml的基本语法构成,适合一般学习者使用
After learning how to install and becoming familiar with the basics of the Flex Builder 2 software, you will explore in depth how ActionScript 3.0 interacts with Flexs powerful XML-like design ...
实现了计算器的加减乘除开根号和幂操作。没有去实现AS和MXML分离。 想研究的同学下载吧。。将文件解压后导入到FB 3.0 中
pdf格式的flex的mxml语法,适合想学习flex的新手
side code. * Learn how states can smoothly transition your application interfaces between different data displays. <br>Put quite simply, this book is all youll need to master Flex 2 and ...
side code. * Learn how states can smoothly transition your application interfaces between different data displays. <br>Put quite simply, this book is all youll need to master Flex 2 and ...
MXML语法.MXML flexview actionscript
《精通Flex 3.0——基于ActionScript 3.0实现》一书源代码。 Flex 3.0 ActionScript 3.0源代码 Flex 3.0源代码。 --------------------------- 第1篇 Flex技术概述 第1章 Flex概述 3 1.1 Flex简介 3 1.2 Flex...
About MXML programming files and Flex usage.
and is designed to teach beginning Flex developers the details of building and architecting real-world rich internet applications using Flash Builder incorporating MXML and ActionScript 3.0....
一个上课用的ppt文档,更容易让你对mxml更为的了解。。
<br> <br>Flex用MXML和ActionScript来编写。MXML最终编译成SWF文件。MXML就是在XML上写HTML 。MXML比HTML更结构化,提供了跟丰富的标签。 <br>ActionScript和JavaScript都是客户端语言。我对ActionScript...
初学者一般会遇到这样的问题,flex项目编译时找不到html文件,这是因为mxml没有自动生成.html
Flex简介 MXML ActionScript Flex中的事件 Flex的组件概述 。。。。。。
大多数MXML标签相当于ActionScript 3.0的类或者类属性。Flex解析MXML标签,并将其编译成一个包含对应ActionScript对象的SWF文件。
MXML 扩展 此 README 文件供扩展的贡献者使用。 如果您只想安装最新的稳定版扩展,请访问 . 如需使用扩展的帮助,请访问详细说明。 模块 这个项目分为几个模块。 语言服务器为 Visual Studio Code 和其他支持 . 代码...
ActionScript 3.0 语言和组件参考概述、MXML入门、FLEX入门帮助。
一本良好的新手FLEX入门书籍,涵盖RIA/FLEX/MXML/ACTIONSCRIPT等各知识点