1 Reply Latest reply on Aug 6, 2008 4:58 AM by Newsgroup_User

    how to get total button number in a application

    happyok
      my application:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Button x="120" y="43" label="Button" id="a"/>
      <mx:Button x="231" y="43" label="Button" id="b"/>
      <mx:Button x="349" y="43" label="Button" id="c"/>
      <mx:Button x="120" y="96" label="Button" id="d"/>
      <mx:Button x="231" y="96" label="Button" id="e"/>
      <mx:Button x="349" y="164" label="Button" id="f"/>

      </mx:Application>


      i want to get all button number,and i want to contorl keyboard's up dowm left right key to get the corresponding button,please offer code

      ths
        • 1. Re: how to get total button number in a application
          Level 7

          "happyok" <webforumsuser@macromedia.com> wrote in message
          news:g7bk07$o5p$1@forums.macromedia.com...
          > my application:
          >
          > <?xml version="1.0" encoding="utf-8"?>
          > <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
          > layout="absolute">
          > <mx:Button x="120" y="43" label="Button" id="a"/>
          > <mx:Button x="231" y="43" label="Button" id="b"/>
          > <mx:Button x="349" y="43" label="Button" id="c"/>
          > <mx:Button x="120" y="96" label="Button" id="d"/>
          > <mx:Button x="231" y="96" label="Button" id="e"/>
          > <mx:Button x="349" y="164" label="Button" id="f"/>
          >
          > </mx:Application>
          >
          >
          > i want to get all button number,and i want to contorl keyboard's up dowm
          > left right key to get the corresponding button,please offer code

          If you use a click event on each button,
          event.currentTarget.id.charCodeAt(0)-97 in the click handler will give you
          the button number.

          For the keyboard input, try
          http://livedocs.adobe.com/flex/3/html/help.html?content=Capturing_User_Input_3.html