The fMenu component allows you to set up menus that can be edited with, and interact with the fCMSPro. This basic tutorial will describe its most common use, for a more detailed example please refer to the BMW Case Study.
Having set up your fMaster component press Ctrl+F3 (Win) or Cmnd+F3 (Mac) with the fMaster still selected to open the properties panel and ensure the instance name of the fMaster component is set to 'fMaster' (without the quotes).
Press Ctrl+F7 (Win) or Cmnd+F7 (Mac) to open the components panel and drag a copy of the fMenu component onto the stage.
With the fMenu component still selected open the properties panel and set the component's instance name to 'fMenu'. Position and size the component.
Press Alt+F7 to open the component inspector panel, double-click the value next to the nodeLabels parameter to open the values dialogue box. Click the plus sign three times to enter three values named 'one', 'two' and 'three'. Click 'OK'.
Still in the component inspector panel set the orientation to horizontal.
Create a new layer, select the keyframe and press Alt+F9 to open the actions panel.
Enter the following code to set up an fcmsInit event that will be triggered when the fMaster initializes:
fMaster.addEventListener( "fcmsInit", this ); function fcmsInit( eo:Object )
{ }
Adjust the above code to set up a click event that will be triggered when the fMenu is clicked:
fMaster.addEventListener( "fcmsInit", this );
function fcmsInit( eo:Object )
{
fMenu.addEventListener( "click", this );
}
function click( eo:Object )
{
}
Finally adjust the above code as follows to include the code necessary to move the timeline to different frame labels depending on which menu item is clicked.
fMaster.addEventListener( "fcmsInit", this );
function fcmsInit( eo:Object )
{
fMenu.addEventListener( "click", this );
}
function click( eo:Object )
{
switch ( eo.node.label ) {
case "one":
gotoAndStop("label_one");
break;
case "two":
gotoAndStop("label_two");
break;
case "three":
gotoAndStop("label_three");
break;
}
}
(For this code to work correctly you will need to set up frame labels named 'label_one', 'label_two' and 'label_three'.)