8 Replies Latest reply on Dec 8, 2010 4:11 PM by Ansury

    Flex is BrainDEAD !

    VirtualCoder Level 1

      Why does code hinting let me use Stage?

      Why does compiler let me run the application?

      Why does it then throw me a run time error?

       

      ---------------------------------------

      Here is the brain dead code ...

      ---------------------------------------

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

         xmlns:s="library://ns.adobe.com/flex/spark"

         xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"

         creationComplete="init()">

      <fx:Script>

      <![CDATA[

      private function init():void

      {

      var s:Stage = new Stage();

       

      }

      ]]>

      </fx:Script>

      <fx:Declarations>

      <!-- Place non-visual elements (e.g., services, value objects) here -->

      </fx:Declarations>

      </s:Application>

      ---------------------------------------------------
      Here is the brainless run time error ...
      --------------------------------------------------
      ArgumentError: Error #2012: Stage class cannot be instantiated.
      atLogo/init()[C:\DRZ\FalshBuilder\CouchDB\Logo\src\Logo.mxml:10]
      atLogo/___Logo_Application1_creationComplete()[C:\DRZ\FalshBuilder\CouchDB\Logo\src\Logo.m xml:5]
      atflash.events::EventDispatcher/dispatchEventFunction()
      atflash.events::EventDispatcher/dispatchEvent()
      atmx.core::UIComponent/dispatchEvent()[E:\dev\4.x\frameworks\projects\framework\src\mx\cor e\UIComponent.as:12528]
      atmx.core::UIComponent/set initialized()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1627]
      atmx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framew ork\src\mx\managers\LayoutManager.as:759]
      atmx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\project s\framework\src\mx\managers\LayoutManager.as:1072]