Previous Page
Next Page

Tripod >> 3pod Tips & Learning and manuals for educations

Recipe 14.3. Creating a Jump Menu

Problem

You want to create a jump menua menu that causes some action to take place as soon as the user makes a selection.

Solution

Use a combo box or a list in conjunction with a listener object.

Discussion

The combo box and list components dispatch change events when the user makes a selection. Therefore, if you use a listener object to handle those events, you can have Flash perform some tasks as soon as the user chooses an item from the combo box or list. This type of functionality is often referred to as a jump menu.

In the following example, a listener object is registered with a combo box named ccbProducts. When the user makes a selection from the combo box, the value is displayed in the Output panel.

	var oListener:Object = new Object();
	oListener.change = function(oEvent:Object):Void {
	  trace(oEvent.target.value);
	};
	ccbProducts.addEventListener("change", oListener);

For more information regarding using listener objects, see Recipe 14.1.

See Also

Recipe 14.1, Recipe 13.12

Tripod >> 3pod Botom Tips & Learning and manuals for educations

Previous Page
Next Page

 

bluedot bluedots greydots pinkdots

Tripod >> 3pod Tips & Learning and manuals for educations