`

Flex view source的实现

    博客分类:
  • flex
阅读更多

      Flex view source的实现当我们在网上浏览运行Flex应用程序时,大家肯定也留意到了有很多swf文件的右键有一个view source菜单,单击它就可以查看该应用的mxml文件及下载其它相关资源。这确实是一种快速共享Flex学习资源的好方法。然而,这一功能是怎样实现的呢? 借助强大的Flex Builder,这一功能实现起来很容易。

      具体步骤如下: 至少打开一个Flex工程,单击Project > Publish Application Source,弹出Publish Application Source对话框。我们可以选择一个Flex工程,选择在浏览器中就可以浏览的目标工程中的mxml文件,选择相关的打包下载文件。最后单击OK,Flex Bulider将自动为我们在Application标签中添加viewSourceURL属性,并且将发布的资源文件整合到一套Html模块中供网上浏览下载。

      如果我们没有Flex Bulider,不要着急,可以用Flex framework API手动来实现:

import com.adobe.viewsource.ViewSource; 
ViewSource.addMenuItem(this, "srcview/index.html");

或者在项目<mx:application 中添加 viewSourceURL="srcview/index.html"

 

      在tomcat下面需要放置资源文件,一开始我纳闷tomcat下面的那些文件怎么发布过去的。难道flexbuilder这么不智能,还需要我们程序员手工复制粘贴吗?在网上找了些配置方法,但我的flexbuilder及eclipse flexbuilder plugin中都不能找到那些选项。最终请教高人找到了答案。工程--export--release--勾上view source 就行了

分享到:
评论

相关推荐

    flexviewer-2.1 源码

    ======================= ArcGIS Viewer for Flex 2.1 build date 2010-09-21 ======================= This file contains the complete source code for the ArcGIS Viewer for Flex.

    arcgis-viewer-flex:ArcGIS Viewer for Flex的源代码-Web应用程序的出色应用程序框架-Web source code view

    arcgis-viewer-flex 这是ArcGIS Viewer for Flex(又名Flex Viewer)的源代码。 在了解有关Flex Viewer的更多信息。 特征 适用于ArcGIS Server的即用型GIS Web客户端映射应用程序。 完整的Web制图应用程序和应用...

    EfflexExplorer

    Flex Effect 特效 大全 , 用IE 打开后,点击 Visible 就可以看见效果,右键可以View Source.

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - ADD: Added the method TCustomProp.Assign - a source flex-property is written to stream, which is then read by the flex-property, for which the Assign method is called. - ADD: In TIdPool (module ...

    as3soundeditorlib-view-and-playback-MP3.rar_FlashMX/Flex源码_FlashMX_

    Open source as3soundeditorlib

    网络解析Httpery

    flex: 1, justifyContent: "center", alignItems: "center", backgroundColor: "#F5FCFF" }, welcome: { fontSize: 20, textAlign: "center", margin: 10 }, instructions: { textAlign: "center", ...

    FlashBuilder

    Flex mobile 开发手机小项目 import flash.ui.Multitouch; import flash.ui.MultitouchInputMode; private function onSwipe(event:TransformGestureEvent):void{ if(event.offsetX == -1){ ...

    asp.net知识库

    HttpModule 实现 ASP.Net (*.aspx) 中文简繁体的自动转换,不用修改原有的任何代码,直接部署即可! 服务器自定义开发二之客户端脚本回发 Web开发: 使用URL重写WEB主题切换 如何在Asp.Net1.1中实现页面模板(所谓的...

    wireshark源码

    if you installed libpcap from source, did you also do "make install-incl", and if you installed a binary package of libpcap, is there also a developer's package of libpcap, and did you also install ...

    wireshark-1.12.0最新源码

    if you installed libpcap from source, did you also do "make install-incl", and if you installed a binary package of libpcap, is there also a developer's package of libpcap, and did you also install ...

    Flash Sample

    The source files for these movies can be found in the Flash MX/Samples folder. Notice You may reuse these files as you want, but they are not officially supported as part of the product....

    RxLib控件包内含RxGIF,全部源码及DEMO

    found as "View | Project Resources" in the Delphi 3 and C++Builder 3 IDE menu and as "Project | Resources" in the Delphi 4 or higher IDE menu. 3. Units that provide functions and objects to work with...

    VB编程资源大全(英文源码 控件)

    &lt;END&gt;&lt;br&gt;17 , resizable7segment_source.zip An Active-X control that simulates a 7 segment L.E.D display.&lt;END&gt;&lt;br&gt;18 , xartery1.zip 20 image digital art gallery in 2 galleries, housed in an ...

    Thinking in Java 4th Edition

    Source code ........................... 12 Coding standards ......................... 14 Errors .................................... 14 Introduction to Objects 15 The progress of abstraction ............

Global site tag (gtag.js) - Google Analytics