我正在将现有的构建脚本从<mxmlc />to转换<compc />为生成 swc。
但是,构建失败,给出错误:
[compc] C:\xxxx\LogViewer.mxml(32): Error: Access of undefined property VERSION.
[compc]
[compc] private static const VERSION:String = CONFIG::VERSION;
Run Code Online (Sandbox Code Playgroud)
在我的 ant 任务中,我定义了以下内容:
<compc compiler.as3="true" output="${output.dir}/${swc.name}.swc" incremental="true" fork="true" maxmemory="512m" compiler.show-deprecation-warnings="false">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
<source-path path-element="${srcdir}" />
<include-sources dir="${srcdir}" includes="*" />
<external-library-path dir="${swc.libs.dir}" append="true">
<include name="*.swc" />
</external-library-path>
<external-library-path dir="${output.common.swc.dir}" append="true">
<include name="*.swc" />
</external-library-path>
<compiler.define name="CONFIG::VERSION" value="${build.version}" />
<compiler.define name="CONFIG::RELEASE" value="${config.release}" />
<compiler.define name="CONFIG::DEBUG" value="${config.debug}" />
<compiler.define name="CONFIG::AUTOMATION" value="false" />
</compc>
Run Code Online (Sandbox Code Playgroud)
这种方法可以很好地完成任务,但现在失败了。
在 compc 中使用编译器常量的正确方法是什么?
我真的不明白这两者之间的区别
event.target and
event.CurrentTarget and explanation.
Run Code Online (Sandbox Code Playgroud)
有人可以用一个简单的例子向我解释这一点吗?
我正在使用 Adobe Flex 4.6,我有这个图像:
<mx:Image source="assets/logo.png" horizontalAlign="center" verticalAlign="middle"></mx:Image>
Run Code Online (Sandbox Code Playgroud)
图像出现,但它没有水平或垂直居中,如何使该图像居中?
我还尝试过以下方法:
<mx:Canvas width="100%">
<mx:HBox horizontalCenter="0" verticalCenter="0">
<mx:Image source="assets/logo.png" horizontalAlign="center" verticalAlign="middle"></mx:Image>
</mx:HBox>
</mx:Canvas>
Run Code Online (Sandbox Code Playgroud)
还是什么都没有,我的形象不会居中
Eclipse具有内置功能,可以查找未使用的变量(我猜这些方法也是如此).Flash Builder 4构建于Eclipse之上,但它没有该功能.你知道任何插件来实现这个功能吗?此外,如果你知道除了SourceMate以外的任何其他类型的插件来改进Flash Builder,请告诉我.
apache-flex eclipse eclipse-plugin actionscript-3 flash-builder
我正在尝试使用Javascript回调到我的页面中嵌入的Flex应用程序.通过一些示例,我看到这段代码用于获取Flex应用程序的引用:
// Get the reference:
function thisFlexApp(appName) {
if(navigator.appName.indexOf ('Microsoft') != -1) {
return window[appName];
}
else {
return window.document[appName];
}
}
// Use it:
var someVariable = thisFlexApp('NameOfFlexApp').callbackMethod();
Run Code Online (Sandbox Code Playgroud)
我使用了那个方法,但是使用IE9我得到错误,表明"thisFlexApp"调用不起作用.事实证明window.document [appName]在IE9中工作,但是窗口[appName]没有.由于我不希望我的政府客户使用IE9,我想知道这种方法的IE版本实际上会起作用的是什么版本?是否有另一个测试更好地使用而不是上面假设所有版本的IE以某种方式工作?提前致谢.
javascript apache-flex internet-explorer callback externalinterface
我有一个Flex Spark List,可以填充任意数量的行.每行可以具有可变高度,最小为50px.我需要一种滚动到"真实"底部的方法.我的意思是最后一行的结尾.由于我是AS和Flex的新手,如果需要任何高级功能(例如扩展类等),将会欣赏实现和使用代码.
我正在adobe flex中实现一个与android相关的应用程序,生成.apk,现在在模拟器中安装.apk文件时,模拟器显示一个弹出安装adobe air,同时再次安装在adobe air上,它显示没有移动设备已连接到您的系统.那么如何在仿真器中安装adobe air来测试adobe flex中的应用呢?
在此先感谢Narasimha
我正在尝试在Flex 4.5移动项目中使用SharedObject.我使用的SDK是4.5.1,AIR版本是2.6.0.
我正在尝试使用以下代码在本地存储我的应用程序的用户凭据:
var so:SharedObject = SharedObject.getLocal("cred");
so.data.user = txtUser.text;
so.data.password = txtPass.text;
so.data.rememberMe = isLoginRemembered.selected;
var result:String = so.flush();
Run Code Online (Sandbox Code Playgroud)
之后,当应用程序再次加载时,我想使用以前保存的SharedObject凭据,因此用户不需要每次都输入他的凭据.
var so:SharedObject = SharedObject.getLocal("cred");
txtUser.text = so.data.user;
txtPass.text = so.data.password;
isLoginRemembered.selected = so.data.rememberMe;
Run Code Online (Sandbox Code Playgroud)
但这似乎不起作用,用户和密码从未保存过,因此无效.如果我在我的文件系统(Mac OSX)上寻找cred.sol文件,我甚至找不到该文件!这一切都在"结果"字符串中显示为"刷新".
我正在Mac上开发这个应用程序,并希望部署到iOS.
有什么建议?
我是Actionscript编程的新手.我试图弄清楚从函数返回多个变量的最佳方法是什么,每个变量都有不同的数据类型.例如,如果函数需要返回变量aa(字符串)和变量bb(数字).
我正在使用的函数只是处理大量的数学运算,并且与GUI中的对象无关.我从Google搜索获得的一种方法使用了一个Object,但是(我认为)这需要我创建一个类,我想知道是否有更简单的方法.由于数组可以包含不同数据类型的元素,因此这可能是一种更简单的方法(?).
以下是David Gassner从"Flash Builder 4和Flex 4 Bible"中获取的mxml和AS3文件示例.
文件:Calculator.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:components="components.*">
<fx:Script source="calculator.as"/>
<s:Panel title="Calculator" horizontalCenter="0" top="20">
<s:layout>
<s:VerticalLayout horizontalAlign="center"/>
</s:layout>
<mx:Form>
<components:ButtonTile id="input"
select="selectHandler(event)"
calculate="calculateHandler(event)"/>
<mx:FormItem label="Entry:">
<s:TextInput text="{currentInput}" editable="false" width="80"/>
</mx:FormItem>
<mx:FormItem label="Total:">
<s:TextInput text="{currentResult}" editable="false" width="80"/>
</mx:FormItem>
</mx:Form>
Run Code Online (Sandbox Code Playgroud)
file:calculator.as
//ActionScript code for Calculator.mxml
[Bindable]
private var currentResult:Number=0;
[Bindable]
private var currentInput:String="";
private function calculateHandler(event:Event):void
{
currentResult += Number(currentInput);
currentInput="";
}
private function selectHandler(event:TextEvent):void
{
currentInput += event.text;
}
Run Code Online (Sandbox Code Playgroud)
有人可以说明如何修改calculator.as中的一个函数,作为一个例子,如何返回两个值,其中一个是数字而另一个是字符串?是否有明显的最佳方式来实现这一目标,或者,不同方法的优点/缺点是什么?提前致谢!
我有一个标签,当你点击一个按钮时,它会从var获得它的价值.var已经声明:
public function clickevent
{
label.text = aVariable;
}
Run Code Online (Sandbox Code Playgroud)
现在我知道如果我有这样的标签:
<s:Label id="label2" text="{aVariable}"/>
Run Code Online (Sandbox Code Playgroud)
并且aVariable是空的,label2的文本是Null(它没有给出错误,在我的情况下只是"Null").这是我目前的情况.
我想知道的是,例如,当我稍后将aVariable的值更改为字符串"hasChanged"时.label2的文本也应更改为"hasChanged",而无需用户按下按钮或任何内容进行此更改.如何才能做到这一点?
apache-flex ×10
actionscript ×4
flash ×3
adobe ×1
air ×1
android ×1
ant ×1
callback ×1
compc ×1
components ×1
eclipse ×1
javascript ×1
list ×1
mxmlc ×1
scroll ×1