| Package | com.happytoad.libs.riatrax | ![]() |
| Class | public class Menu | |
| Inheritance | Menu mx.controls.Menu |
See also
| Property | Defined by | ||
|---|---|---|---|
| gaAction : String
String to be passed to Google as the Action property.
| Menu | ||
| gaCategory : String
String to be passed to Google as the Category property.
| Menu | ||
| gaLabel : String
String to be passed to Google as the Label property.
| Menu | ||
| gaMode : String
String to set tracking mode for compoment.
| Menu | ||
| gaValue : Number
Number to be passed to Google as the Value property.
| Menu | ||
| Method | Defined by | ||
|---|---|---|---|
|
Menu()
Constructor.
| Menu | ||
|
createMenu(parent:DisplayObjectContainer, mdp:Object, showRoot:Boolean = true):Menu
[static]
Creates and returns an instance of the Menu class.
| Menu | ||
| gaAction | property |
gaAction:String [read-write]
String to be passed to Google as the Action property.
An optional action for the event (e.g. "Play").
public function get gaAction():String
public function set gaAction(value:String):void
| gaCategory | property |
gaCategory:String [read-write]
String to be passed to Google as the Category property.
An optional category for the event (e.g. "Videos").
public function get gaCategory():String
public function set gaCategory(value:String):void
| gaLabel | property |
gaLabel:String [read-write]
String to be passed to Google as the Label property.
An optional descriptor for the event.
public function get gaLabel():String
public function set gaLabel(value:String):void
| gaMode | property |
gaMode:String [read-write]
String to set tracking mode for compoment. ( unique | all | none )
This property defaults to unique. Set to all to track all events or none to disable tracking
public function get gaMode():String
public function set gaMode(value:String):void
| gaValue | property |
gaValue:Number [read-write]
Number to be passed to Google as the Value property.
An optional value to be aggregated with the event.
public function get gaValue():Number
public function set gaValue(value:Number):void
| Menu | () | constructor |
public function Menu()Constructor.
| createMenu | () | method |
public static function createMenu(parent:DisplayObjectContainer, mdp:Object, showRoot:Boolean = true):Menu
Creates and returns an instance of the Menu class. The Menu control's
content is determined by the method's mdp argument. The
Menu control is placed in the parent container specified by the
method's parent argument.
This method does not show the Menu control. Instead,
this method just creates the Menu control and allows for modifications
to be made to the Menu instance before the Menu is shown. To show the
Menu, call the Menu.show() method.
parent:DisplayObjectContainer — A container that the PopUpManager uses to place the Menu
control in. The Menu control may not actually be parented by this object.
|
|
mdp:Object — The data provider for the Menu control.
|
|
showRoot:Boolean (default = true) — A Boolean flag that specifies whether to display the
root node of the data provider.
|
Menu —
An instance of the Menu class.
|
See also
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:rx="com.happytoad.libs.riatrax.*"
creationComplete="init()">
<mx:Script>
<![CDATA[
import com.happytoad.libs.riatrax.Tracker;
import com.happytoad.libs.riatrax.Menu;
import flash.geom.Point;
private var tracker:Tracker = Tracker.getInstance();
private function init():void{
tracker.account="UA-xxxxxx-y";
tracker.display=this;
tracker.visualDebug = true;
}
private var point1:Point = new Point();
private var menu:Menu;
private var dataset:Array = [{"data":"onedata","label":"onelabel"},
{"data":"twodata","label":"twolabel"}];
private function showMenu():void {
menu= Menu.createMenu(panel, dataset, false);
menu.labelField="label"
menu.gaMode = "none";
point1.x=panel.x;
point1.y=panel.y;
point1=panel.localToGlobal(point1);
menu.show(point1.x + 25, point1.y + 25);
}
]]>
</mx:Script>
<mx:Panel id="panel" title="Menu Control Example" height="80%" width="80%"
layout="absolute" horizontalCenter="0" verticalCenter="0">
<mx:Button label="Open Menu" click="showMenu();"
horizontalCenter="0" verticalCenter="0"/>
</mx:Panel>
</mx:Application>