2 Replies Latest reply on Mar 21, 2007 4:33 PM by cheftimo

    Can't find the 'as' syntax explanation

    webjoseph
      Hi Folks,

      I looked everywhere, including the syntax documentation. Because the keyword 'as' is short and generic, it is hard to find on Google/Forums. Can someone explain to me what the 'as' keyword/operator/statement does? Is it a typecasting technique, object instance declaration, or some inheritance method? I ran into it looking at OPC (other people's code) and I can't grasp when/why to use it.

      You can see it as one of the reserved keywords here:
      http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00001828.html

      Here's a code example:

      /*
      * Launch the create room window
      */
      public function bt_create_click():void
      {
      createRoomWin = PopUpManager.createPopUp(this, CreateRoomWindow, true) as TitleWindow
      createRoomWin["bt_create"].addEventListener("click", handleCreateRoom)
      }