1 Reply Latest reply on Jul 1, 2010 1:04 PM by Alex Uhlmann

    PopUp 1.7  TypeError: Error #1034

    docwisdom

      Hello,


      I just started using Cairngorm popup and it looks to work great so far. I am using it top open up titlewindow components. I dont get any compiler errors, but unfortunately flash debug version shows this error when I use the close button.

       

      Opening the popup works just fine BTW


       

      __________________________

       

       

      TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@10a9fdf9 to mx.events.CloseEvent.

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework \src\mx\core\UIComponent.as:12266]

      at components::newTicket/___newTicket_TitleWindow1_close()[/Users/brian/Documents/ Adobe Flash Builder 4/PRISM/src/components/newTicket.mxml:9]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework \src\mx\core\UIComponent.as:12266]

      at spark.components::TitleWindow/closeButton_clickHandler()[E:\dev\4.0.0\framework s\projects\spark\src\spark\components\TitleWindow.as:458]

      __________________________

       


       

      If I disable the error console it works just fine. Any thoughts on getting rid of this error?
      Here is the code from the popup component mxml



      __________________________

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

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

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

         xmlns:mx="library://ns.adobe.com/flex/mx"

         xmlns:popup="com.adobe.cairngorm.popup.*"

         title="Receive Items" x="800" y="600" width="800" height="264" close="dispatchEvent(new Event(Event.CLOSE))" textAlign="left">

      <s:layout>

      <s:VerticalLayout  horizontalAlign="center"/>

      </s:layout>

      <fx:Script>

      <![CDATA[

       

       

      ]]>

      </fx:Script>

      <fx:Declarations>

       

      <fx:Array id="category">

      <fx:String>Computers</fx:String>

      <fx:String>Phones</fx:String>

      <fx:String>Rides</fx:String>

      <fx:String>Audio</fx:String>

      <fx:String>Video</fx:String>

      </fx:Array>

       

      </fx:Declarations>

       

      <s:BorderContainer width="680" height="166" borderVisible="false">

      <s:Label text="Requested by: Someone" y="26" x="0"/>

      <s:Label text="Item: Wireless Headset" y="51" x="0"/>

      <s:Label text="Quantity Received:" y="106" x="0"/>

      <s:Label text="Order Date: 06/11/2010" y="26" x="550"/>

      <s:Label text="PO #: 378542" y="43" x="551"/>

      <s:Label text="Quantity Ordered: 1" x="0" y="77"/>

      <s:DropDownList x="105" y="100" width="43"></s:DropDownList>

      <s:CheckBox x="77" y="131"/>

      <s:Label text="Backordered:" y="136" x="0"/>

      </s:BorderContainer>

      <s:controlBarContent>

       

      <mx:Spacer width="100%" />

      <s:Button label="Save" click="dispatchEvent(new Event(Event.CLOSE))"/>

      <s:Button label="Cancel" click="dispatchEvent(newEvent(Event.CLOSE))"/>

       

      </s:controlBarContent>

       

      </s:TitleWindow>

       

      __________________________


       

      thanks!