【发布时间】:2025-12-05 12:25:01
【问题描述】:
你越了解你在做什么,你就会做得越好。
我想深入了解 Flex 。我做了一些简单的事件处理和 你越了解你在做什么,你就会做得越好。
但是我有个大问题:
编译器是做什么的?! MXML 文件会发生什么?
假设我们有一个简单的代码(来自 blogflexexamples 的代码):
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/12/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white">
<mx:Style>
.myColorPicker {
swatchPanelStyleName: myCustomSwatchPanelStyleName;
}
.myCustomSwatchPanelStyleName {
backgroundColor: haloBlue;
}
</mx:Style>
<mx:Script>
<![CDATA[
import mx.events.ColorPickerEvent;
private function backgroundColor_change(evt:ColorPickerEvent):void {
var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myCustomSwatchPanelStyleName");
cssObj.setStyle("backgroundColor", evt.color);
colorPicker.open();
}
]]>
</mx:Script>
<mx:ApplicationControlBar dock="true">
<mx:Form styleName="plain">
<mx:FormItem label="backgroundColor:">
<mx:ColorPicker change="backgroundColor_change(event);" />
</mx:FormItem>
</mx:Form>
</mx:ApplicationControlBar>
<mx:ColorPicker id="colorPicker"
styleName="myColorPicker"
editable="false" />
</mx:Application>
这会生成一个 Actionscript 文件吗? 如果可以:我可以看到 .as 文件(如 C++ 中的预处理器)吗?
【问题讨论】:
标签: actionscript-3 apache-flex flex3