我有一个单例类用于全局访问配置信息.这个名为ConfigurationData的单例类扩展了EventDispatcher.这是一个类(请注意,我保留了一些像变量声明一样的东西来保持这个简短):
/**
* Dispatched when the config file has been loaded.
*/
[Event (name="configurationLoaded", type="flash.events.Event")]
/**
* Dispatched when the config file has been loaded.
*/
[Event (name="configurationLoadFailed", type="flash.events.Event")]
public class ConfigurationData extends EventDispatcher{
// Event name constants.
public static const CONFIGURATION_LOADED:String = "configurationLoaded";
public static const CONFIGURATION_LOAD_FAILED:String = "configurationLoadFailed";
// The singleton instance.
private static var singleton:ConfigurationData;
/**
* Don't call the constructor directly, use getInstance() instead.
*/
public function ConfigurationData(pvt:PrivateClass){
// init
}
/**
* Get the singleton …Run Code Online (Sandbox Code Playgroud) 我有一个灵活的应用程序,有几个计时器运行不同的时间和各种原因.我希望能够停止,如果用户越过指定的时间量所有运行的定时器,但不希望使用timer.stop单独停止计时器();
有没有办法在全球范围内停止所有计时器,或者查找并迭代所有运行并停止它们的计时器?
假设你有
private static const INCLUDE_MY_DEBUG_CODE:Boolean = false;
public function runMyDebugCode():void
{
if ( INCLUDE_MY_DEBUG_CODE )
{
callADebugFunction();
}
}
private function callADebugFunction():void
{
...
}
Run Code Online (Sandbox Code Playgroud)
鉴于没有其他对callADebugFunction的引用,是否可以保证callADebugFunction不是编译构建的一部分?
你越了解自己在做什么,就越能做得更好.
我想深入了解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>
Run Code Online (Sandbox Code Playgroud)
这会生成一个Actionscript文件吗?如果是这样的话:我能看到.as文件(就像C++中的预处理器一样)吗?
我无法检索火花上选定按钮的等效项.
一点代码:
_selectedBtn.selected=false;
请问有什么想法?
我有一个flv文件,并且只想从AIR应用程序中播放.现在我需要以这样的方式保护我的flv文件,使得它无法被世界上任何其他现有的flv播放器打开或播放.如果有人双击那个flv文件,那么动作将为零或不被现有的flv播放器播放世界,只有我自己的球员发挥.我怎么能解决这个问题?
我是Flex的新手.我有一个Advance数据网格.我提前点击了数据网格列,stage1使用WSDL打开填充数据.我想在新选项卡或新浏览器选项卡中使用WSDL打开包含填充数据的stage1.如果我在高级数据网格列上单击10次,则应使用WSDL打开10个新选项卡并填充数据.请帮我.
flex3 ×7
apache-flex ×6
flex4 ×2
actionscript ×1
air ×1
events ×1
flash ×1
flex4.5 ×1
flv ×1
singleton ×1