有没有人知道为什么在ComboBox的selectedItem属性上使用BindingUtils时会出现以下警告?任何想法如何解决问题?
绑定仍然可以正常工作,但摆脱警告会很好.
warning: multiple describeType entries for 'selectedItem' on type 'mx.controls::ComboBox':
<accessor name="selectedItem" access="readwrite" type="Object" declaredBy="mx.controls::ComboBase">
<metadata name="Bindable">
<arg key="" value="valueCommit"/>
</metadata>
Run Code Online (Sandbox Code Playgroud) 我觉得在Flex上很容易找到样本,教程和简单示例.
基于现实项目找到提示和良好实践似乎更难.
有关如何:
这是我的问题 - 我有一些像这样的代码:
<mx:Canvas width="300" height="300">
<mx:Button x="800" />
</mx:Canvas>
Run Code Online (Sandbox Code Playgroud)
所以问题是画布中的Button有一个超过Canvas宽度的x属性方式 - 因为它是Canvas的一个子节点,Canvas屏蔽它并为我创建一些滚动条以滚动到按钮.
我想要的是在没有滚动条的情况下显示按钮 - 画布左侧800像素,同时仍然将按钮保留为画布的子画面.我怎么做?
在Flex中,有时当您需要清除表单时遇到单选按钮组似乎无法清除的问题:尽量尝试,在所有按钮上设置selected = false,在组上设置selection = null,同时执行这两项操作他们两次,等等,你似乎总是有一个仍然被选中的讨厌的小单选按钮.你如何解决这个问题并将单选按钮组恢复到其初始的无选择状态?
好的,我按字母顺序对XMLListCollection进行排序.我有一个问题.如果值为"ALL",我希望它在列表中排在第一位.在大多数情况下,这种情况已经发生,但数字值正在"ALL"之前进行排序.我希望"ALL"始终是我的dataProvider中的第一个选择,然后按字母顺序排列.
所以我正在尝试编写自己的排序函数.有没有办法可以检查其中一个值是否全部,如果没有告诉它对值进行常规比较?
这是我有的:
function myCompare(a:Object, b:Object, fields:Array = null):int
{
if(String(a).toLowerCase() == 'all')
{
return -1;
}
else
if(String(b).toLowerCase() == 'all')
{
return 1;
}
// NEED to return default comparison results here?
}
//------------------------------
var sort:Sort = new Sort();
sort.compareFunction = myCompare;
Run Code Online (Sandbox Code Playgroud)
对于我想要做的事情,有没有解决方案?
我想自动构建一个flex库项目而不是当前进程,这涉及我们的一个开发人员在他的机器上编译它然后我们检查生成的.swc文件.这很糟糕.
我是从Java开发人员的角度来看这个,所以我很难掌握Flex Builder 3应用程序中提供的编译工具,但这就是我已经拥有的:
<mxmlc/>和执行<compc/>任务.我想要的是一个ant脚本,它将完成以下步骤:
到目前为止我有这个:
<target name="compile-component" depends="init">
<compc output="${DEPLOY_DIR}/${SWC_NAME}.swc">
<source-path path-element="${FLEX_HOME}/frameworks"/>
<source-path path-element="${SRC_DIR}"/>
</compc>
</target>
Run Code Online (Sandbox Code Playgroud)
但是,它不包括任何内容:
[compc] Loading configuration file /Applications/Adobe Flex Builder 3/sdks/3.2.0/frameworks/flex-config.xml
[compc] Adobe Compc (Flex Component Compiler)
[compc] Version 3.2.0 build 3958
[compc] Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
[compc]
[compc] Error: nothing was specified to be included in the library
[compc]
[compc] Use 'compc -help' for information about using the command line.
Run Code Online (Sandbox Code Playgroud)
看起来我需要枚举我想要包含在库中的每个类,这是......荒谬的.肯定有更好的办法.我该怎么做呢?
我试图围绕其中心点三维旋转一个Sprite,我正在努力理解matrix3D的一些行为.
我已经重写了Sprite的set rotationX,rotationY和rotationZ方法,如下所示:
override public function set rotationX (_rotationX:Number) : void {
this.transform.matrix3D.prependTranslation(this.width/2.0, this.height/2.0, 0);
this.transform.matrix3D.prependRotation(-this.rotationX, Vector3D.X_AXIS);
this.transform.matrix3D.prependRotation(_rotationX, Vector3D.X_AXIS);
this.transform.matrix3D.prependTranslation(-(this.width/2.0), -(this.height/2.0), 0);
}
override public function set rotationY (_rotationY:Number) : void {
this.transform.matrix3D.prependTranslation(this.width/2.0, this.height/2.0, 0);
this.transform.matrix3D.prependRotation(-this.rotationY, Vector3D.Y_AXIS);
this.transform.matrix3D.prependRotation(_rotationY, Vector3D.Y_AXIS);
this.transform.matrix3D.prependTranslation(-(this.width/2.0), -(this.height/2.0), 0);
}
override public function set rotationZ (_rotationZ:Number) : void {
this.transform.matrix3D.prependTranslation(this.width/2.0, this.height/2.0, 0);
this.transform.matrix3D.prependRotation(-this.rotationZ, Vector3D.Z_AXIS);
this.transform.matrix3D.prependRotation(_rotationZ, Vector3D.Z_AXIS);
this.transform.matrix3D.prependTranslation(-(this.width/2.0), -(this.height/2.0), 0);
}
Run Code Online (Sandbox Code Playgroud)
我使用prependTranslation来校正旋转的中心点,并使用第一个prependRotation来取消任何先前应用的旋转.
测试它,rotationX完全按预期工作,并且Sprite围绕其水平轴旋转.
rotationY和rotationZ也似乎工作正常.但是,存在一个问题:每当设置rotationY或rotationZ时,所有其他旋转值也会改变.这对rotateX来说不是问题 - 如果我设置了rotationX,则没有其他更改.但是如果我设置了rotationY或者旋转Z,则所有旋转值都会发生变化,这对我的应用程序来说是一个问题(它试图保存和恢复值).
我想我对matrix3D的情况缺乏了解.我如何实现这一点,以便值之间没有相互依赖性?
我无法使用Vector类使map()函数完全正常工作.
结果总是返回null - 它应该返回一个带有addFive函数返回值的新向量(这个例子显然不是我真正的用例).
阵列版本按预期工作.
有没有人有幸得到map()与Vector合作?
public function test_vector_map():void {
var v1:Vector.<uint> = new <uint>[1,2,3];
trace(v1); // traces 1,2,3
var v2:Vector.<uint> = v1.map(addFive);
trace(v2); // traces null
}
protected function addFive(item:uint, index:int, vector:Vector.<uint>):uint
{
return item+5;
}
public function test_array_map():void {
var v1:Array = [1,2,3];
trace(v1); // traces 1,2,3
var v2:Array = v1.map(addSix);
trace(v2); // traces 7,8,9
}
protected function addSix(item:uint, index:int, array:Array):uint
{
return item+6;
}
Run Code Online (Sandbox Code Playgroud) 我已经下载了Flex 4.5 SDK的发布版本(4.5.0.20967),但它似乎缺少10.3版本的playerglobal.swc.
在测试期间,我可以访问Adobe Labs网站并获得beta playerglobal.swc,但现在链接显示它已不再托管在那里.
如果不是SDK,我们应该从哪里获取playerglobal.swc?
任何人都可以告诉我组件的visible和includeInLayout属性,以及组件{false,false},{false,true},{true,false}时的组件状态.先感谢您.
apache-flex ×10
flash ×3
mxml ×2
3d ×1
actionscript ×1
adobe ×1
air ×1
ant ×1
blazeds ×1
flex3 ×1
flexbuilder ×1
puremvc ×1
radio-button ×1
rotation ×1
sorting ×1