我需要删除与Flex 3关联数组中的属性关联的值; 这可能吗?
例如,假设我创建了这样的数组:
var myArray:Object = new Object();
myArray[someXML.@attribute] = "foo";
Run Code Online (Sandbox Code Playgroud)
后来,我需要做这样的事情:
delete myArray[someXML.@attribute];
Run Code Online (Sandbox Code Playgroud)
但是,我在运行时收到此错误消息:
Error #1119: Delete operator is not supported with operand of type XMLList.
Run Code Online (Sandbox Code Playgroud)
我该如何执行此操作?
我有一个用户键入的字符串,我想将其保存到用户硬盘上的文件中.你能做到吗?如果是这样,怎么样?
如果类型为object的传递参数为空,我想检查我的函数.有时它是空的但仍然不是null因此我不能依赖于null条件.是否有一些属性,如'长度'/'大小'的flex对象,我可以在这里使用.请帮忙.提前致谢.
使用起来会更快吗?
myString.replace(/foo/g,"bar")
Run Code Online (Sandbox Code Playgroud)
而不是
myString.split("foo").join("bar")
Run Code Online (Sandbox Code Playgroud)
对于ActionScript 3中的长字符串?或者他们只是两种可比的方法来实现相同的结果?
我想(通过谷歌分析)计算弹出窗口显示给用户的次数.我应该使用哪个事件来推断弹出窗口正在向用户显示?
解:
如果你有同样的问题,addElement()而不是addChild()就是这样做的
我正试图从mxml转移到actionsctipt.我有一个<s:Rect>我已创建并设置其属性,但无法添加它.
var aRect:Rect = new Rect();
//set properties like aRect.x, aRect.y, aRect.width, aRect.height
//tried adding it various ways
addChild(aRect);
Application.addChild(aRect);
Application.application.addChild(aRect);
stage.addChild(aRect);
Run Code Online (Sandbox Code Playgroud)
但我一直得到错误 1067:类型spark.primitives的值的隐式强制:Rect到不相关的类型flash.display:DisplayObject
最初是在mxml中,它内部<s:Application>没有嵌套在任何内容中
<s:Application>
<s:Rect id="aRect" x="10" y="10" width="15%" height="15%">
//then fill code here, removed for readability
</s:Rect>
</s:Application>
Run Code Online (Sandbox Code Playgroud)
什么是交易,我认为actionscript会比mxml更好.
是否可以将regexp模式匹配转换为小写?
var pattern:RegExp;
var str:String = "HI guys";
pattern = /([A-Z]+)/g;
str = str.replace(pattern, thisShouldBeLowerCase);
Run Code Online (Sandbox Code Playgroud)
输出应该如下所示:"嗨伙计们"
是否有任何开源flex或flash代码,以适应像farm-ville或类似的游戏的起点
我想知道它们之间有什么区别MouseEvent.CLICK & MouseEvent.MOUSE_DOWN.因为当我用MouseEvent.MOUSE_DOWN一个按钮设置full-screen视图时它不起作用,而不是这个MouseEvent.CLICK工作.那是什么原因呢.
如果我尝试打开放置在空中app文件夹内的文件,我只会收到"错误#3000:非法路径名称".如果文件位于app-folder之外的其他位置,则可以使用.
private var file:File = File.documentsDirectory;
public function download():void{
var pdfFilter:FileFilter = new FileFilter("PDF Files", "*.pdf");
file.browseForOpen("Open", [pdfFilter]);
file.addEventListener(Event.SELECT, fileSelected);
}
private function fileSelected(e:Event):void
{
var destination:File = File.applicationDirectory
destination = destination.resolvePath("test.pdf");
/*
//This works, also if the file to copy is placed inside the appfolder
file.copyTo(destination, true);
*/
/*This Throws me an Error #3000, but ONLY if the file is located in
the App folder*/
file.openWithDefaultApplication();
}
Run Code Online (Sandbox Code Playgroud)
当我尝试获取相同的文件并将其复制到另一个地方时,它做得很好.
为什么?如果我想打开appfolder中的文件,可以做些什么特别的事情?它也不能在调试模式下工作 - bin-debug.
此致,Temo
apache-flex ×10
flash ×4
actionscript ×3
regex ×2
adobe ×1
air ×1
collections ×1
flex3 ×1
flex4 ×1
frameworks ×1
lowercase ×1
mxml ×1
replace ×1
string ×1