flex 右键菜单管理工具类
/*============使用==========*/
var contextmenu:ContextMenuManager=new ContextMenuManager();
contextmenu.add("最大化",menuHandle);//menuHandle处理函数
/**==================ContextMenuManager.as==========================*/
package file
{
import flash.display.InteractiveObject;
import flash.events.*;
import flash.errors.IllegalOperationError;
import flash.ui.*;
import flash.utils.getQualifiedClassName;
public class ContextMenuManager extends EventDispatcher
{
protected var menu:ContextMenu;
protected var target:InteractiveObject;
public function ContextMenuManager(target:InteractiveObject,hideBuiltInItems:Boolean=true)
{
this.target=target;
menu=new ContextMenu();
if(hideBuiltInItems)
{
menu.hideBuiltInItems();
}
this.target.contextMenu=menu;
menu.addEventListener(ContextMenuEvent.MENU_SELECT,passEvent);
}
public function add(caption:String,handler:Function,separatorBefore:Boolean=false,enabled:Boolean=true,visible:Boolean=true):ContextMenuItem
{
var result:ContextMenuItem=createItem(caption,handler,separatorBefore,ena
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.collections.ArrayCollection;
......
1,直接设置属性:
源代码如下:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns:ri="AAA.test.*" >
<mx:DateChooser dayNames="[日,一,二,三,四,五,六]"
monthNames="[一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月]" />
......
HScrollBar {
downArrowUpSkin:
Embed(source=”/assets/downArrow.png”);
downArrowOverSkin:
Embed(source=”/assets/downArrow.png”);
downArrowDownSkin:
Embed(source=”/assets/downArrow.png”);
upArrowUpSkin:
Embed(source=”/assets/upArrow.png”);
upArro ......
使用js来操作flex
首先在fademo.mxml中声明一个button,并添加一个btnClick方法:
<?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="l ......
package
{
import mx.containers.Panel;
import mx.controls.Button;
import flash.events.Event;
import mx.events.FlexEvent;
import flash.events.MouseEvent;
import mx.controls.Alert;
/**
* This class is used to create a Custom Panel
* with Maximum, Minimum, close
* and also drag p ......