`
diding
  • 浏览: 80380 次
  • 性别: Icon_minigender_1
  • 来自: 四川
社区版块
存档分类
最新评论

Flex4 Declarations in ActionScript

    博客分类:
  • Flex
阅读更多
抽空整理Cairgorn3时,由于喜欢Code,而不喜欢Block,所以想把Declarations声明放到AS中去,由于C3采用了spicefactory框架,所以按照spicefactory的官方说明,居然不能build,最后采用-keep方式查看code,修改了一下AS代码,不采用官方的方式,居然成功了,无语!
主文件:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
					   xmlns:s="library://ns.adobe.com/flex/spark"
					   xmlns:mx="library://ns.adobe.com/flex/mx"
					   width="850"
					   height="450"
					   preinitialize="preinit();"
					   creationComplete="init()">
	<fx:Style source="assets/contactsStyles.css"/>
	<fx:Script source="Main.as"/>
</s:WindowedApplication>

<fx:Declarations>
		<spicefactory:ContextBuilder>
			
			<cairngorm:CairngormIntegrationSupport/>
			<spicefactory:FlexConfig type="{InsyncContext}"/>
			<spicefactory:MessageSettings unhandledErrors="{ErrorPolicy.RETHROW}"/>
		</spicefactory:ContextBuilder>
	</fx:Declarations>


以上声明,我想转到AS中去
private function preinit():void
{
	var temp:ContextBuilderTag=new ContextBuilderTag();
	var cairgormIS:CairngormIntegrationSupport=new CairngormIntegrationSupport();
	var flexConfig:FlexConfigTag=new FlexConfigTag();
	flexConfig.type=InsyncContext;
	var messageST:MessageSettingsTag=new MessageSettingsTag();
	messageST.unhandledErrors=ErrorPolicy.RETHROW
	temp.processors=[cairgormIS, flexConfig, messageST];
	temp.initialized(this, "contextBuilderTag")
}

Main.as文件
import com.adobe.cairngorm.CairngormIntegrationSupport;
import flash.display.DisplayObject;
import insync.presentation.ContactList;
import insync.presentation.ContactsNavigator;
import insync.presentation.Toolbar;
import mx.containers.HDividedBox;
import mx.containers.VBox;
import org.spicefactory.parsley.core.messaging.ErrorPolicy;
import org.spicefactory.parsley.flex.FlexConfig;
import org.spicefactory.parsley.flex.FlexContextBuilder;
import org.spicefactory.parsley.flex.tag.builder.ContextBuilderTag;
import org.spicefactory.parsley.flex.tag.builder.FlexConfigTag;
import org.spicefactory.parsley.flex.tag.builder.MessageSettingsTag;

private function preinit():void
{
	var temp:ContextBuilderTag=new ContextBuilderTag();
	var cairgormIS:CairngormIntegrationSupport=new CairngormIntegrationSupport();
	var flexConfig:FlexConfigTag=new FlexConfigTag();
	flexConfig.type=InsyncContext;
	var messageST:MessageSettingsTag=new MessageSettingsTag();
	messageST.unhandledErrors=ErrorPolicy.RETHROW
	temp.processors=[cairgormIS, flexConfig, messageST];
	temp.initialized(this, "contextBuilderTag")
}

private function init():void
{
	var mainVBox:VBox=new VBox();
	mainVBox.percentHeight=100;
	mainVBox.percentWidth=100;
	this.addElement(mainVBox);
	
	var toolBar:Toolbar=new Toolbar();
	toolBar.percentWidth=100;
	mainVBox.addChild(toolBar);
	
	var hdvidedBox:HDividedBox=new HDividedBox();
	hdvidedBox.percentHeight=100;
	hdvidedBox.percentWidth=100;
	mainVBox.addChild(hdvidedBox);
	
	var contactNav:ContactsNavigator=new ContactsNavigator();
	contactNav.percentHeight=100;
	contactNav.percentWidth=100;
	hdvidedBox.addChild(contactNav);
	
	var contactList:ContactList=new ContactList();
	contactList.width=300;
	contactList.percentHeight=100;
	hdvidedBox.addChild(contactList);
}



spicefactory+spicelib(v2.3.1)源码包:org
cairngorm3源码包:com
  • com.rar (361.1 KB)
  • 下载次数: 19
  • org.rar (673.1 KB)
  • 下载次数: 28
分享到:
评论

相关推荐

    Flex4-in-a-day

    Flex 4 in a day About this document Introduction MXML 2009 Namespaces States New MXML Tags Declarations Library Definition Private Reparent DesignLayer Two-way data binding MXML Graphics...

    Placing const in Declarations by Dan Saks

    Placing const in Declarations by Dan Saks

    flex fusionchart 破解

    4.找到fusioncharts文件中FusionChartsFlex\Charts\FlashBuilder4_SWC下面的那个swc文件,将其复制到flex-libs文件夹下: 5.将FusionChartsFlex\Charts下面的FusionCharts和FusionWidgets两个文件夹复制到flex_...

    FLEX 4.5手机开发实例

    FLEX 4.5手机开发实例,将公司内的工作人员目录管理。

    Static修饰内部类

    彦舜原创,CSDN首发:希望对你有所帮助,仅此而已。内容工整规范,是作者本人,逐句敲出来,同时也含有个人的一些独见。

    Flash(ActionScript 3.0) Tree组织结构树

    &lt;fx:Declarations&gt; &lt;!-- 将非可视元素(例如服务、值对象)放在此处 --&gt; &lt;/fx:Declarations&gt; borderVisible="false" treeType="0" doubleClickEnabled="true" mouseEnabled="true" ...

    dom4j api 参考手册

    org.dom4j Defines the XML Document Object Model in Java interfaces together with some helper classes. org.dom4j.bean An implementation of the dom4j API which allows JavaBeans to be used to store and ...

    2-variable-declarations(变量声明2).pdf

    2-variable-declarations(变量声明2).pdf

    var.rar_Conflicts

    An example of using the same variable declarations in different scopes in C++ without conflicts

    css-declarations:解析和字符串化CSS声明

    : npm install css-declarations用import { parse , stringify } from 'css-declarations'var values = parse ( ` color:/*red*/purple; -webkit-border-radius: 3px !important;;` )// =&gt; {color: 'purple', ...

    C++编程思想(thinking in c++)答案

    #include &lt;iostream&gt; // Stream declarations using namespace std; int main() { cout , World! I am " !" ; } Here’s my rewrite: //: S02:Hello2.cpp #include using namespace std; int main()...

    C.in.a.Nutshell.2nd.Edition.1491904755

    With the new edition of this classic book, you'll learn the 2011 standard C language in easy, exact terms. Every C programmer who needs to know the effects of an unfamiliar function, or to understand ...

    Groovy in Action 2nd Edition-Manning(2016)

    even find their way into newer versions of Java: literal declarations for common datatypes, simplified property access, null-safe dereferencing, closures, and more. Surprisingly many languages have ...

    Program in LUA 2nd Edition.rar

    14.2 Global-Variable Declarations 131 14.3 Non-Global Environments 132 15 Modules and Packages 137 15.1 The require Function 138 15.2 The Basic Approach for Writing Modules 141 15.3 Using ...

    declarations.com.ua:我们的项目会数字化并打开所有乌克兰官员的声明

    clarifications.com.ua有用的链接设计: : 将扫描的声明数字化的表格: : 我们的众包框架将用于众包数字化流程: : 各种脚本来清理数据: : R生成分析的先决条件首先安装R 3.1或更高版本然后运行R并安装以下软件包...

    关于IDEA中的.VUE文件报错 Export declarations are not supported by current JavaScript version

    IDEA中的.VUE文件报错 Export declarations are not supported by current JavaScript version 和Export declarations are not supported by current JavaScript version报错都是一个解决办法 js文件报错 第一步,...

    开源项目-nishanths-predeclared.zip

    开源项目-nishanths-predeclared.zip,predeclared: find declarations in source code that override Go's predeclared identifiers

    C in a nutshell 2nd English

    With the new edition of this classic book, you'll learn the 2011 standard C language in easy, exact terms. Every C programmer who needs to know the effects of an unfamiliar function, or to understand ...

Global site tag (gtag.js) - Google Analytics