My problem is that i can't use the class mx.controls.Menu even if i
import in my script.

i'm looking for the solution till this morning,searching and
searching, but with no results....that's why i decide to post this
stupid question

i try to execute the Example: creating a simple Menu control, taken
from the livedocs.macromedia, but it doesn't work.
it seem like it doesn't link the main library of actions scripts 3,
but i tried in all ways to make Flex Builder link to.

envirorment: winxp, Flex Builder
this is the code:
=====================================
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
    <mx:Script>
        <![CDATA[
            // Import the Menu control.
            import mx.controls.Menu;
            // Create and display the Menu control.
            private function createAndShow():void {
                // The third parameter sets the showRoot property to
false.
                // You must set this property in the createMenu
method, not later.
                var myMenu:Menu = Menu.createMenu(null, myMenuData,
false);   <--****1st ERROR HERE***
                myMenu.labelField="@label";
                myMenu.show(10, 10);
            }
        ]]>
    </mx:Script>

    <!-- Define the menu data. -->
    <mx:XML format="e4x" id="myMenuData">
            <menuitem label="MenuItem A" >
                <menuitem label="SubMenuItem A-1" enabled="False" />
                 <menuitem label="SubMenuItem A-2" />
            </menuitem>
            <menuitem label="MenuItem B" type="check" selected="true" />
            <menuitem label="MenuItem C" type="check" selected="false"/>
            <menuitem type="separator" />    
            <menuitem label="MenuItem D" >
                <menuitem label="SubMenuItem D-1" type="radio"
groupName="one" />
                <menuitem label="SubMenuItem D-2" type="radio"
groupName="one"
                    selected="true" />
                <menuitem label="SubMenuItem D-3" type="radio"
groupName="one" />
            </menuitem>
    </mx:XML>

    <mx:VBox>
        <!-- Define a Button control to open the menu -->
        <mx:Button id="myButton" label="Open Menu"
click="createAndShow()" />
    </mx:VBox>
</mx:Application>
=====================================
tha's the errors:
1 - Call to a possibly undefined method 'createMenu' through a
reference with static type 'Class'
2 - Access of possibly undefined property 'labelField' through a
reference with static type 'Menu'
3 - Call to a possibly undefined method 'show' through a reference
with static type 'Menu'


tnx!!
FF





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to