6 Replies Latest reply on Apr 15, 2008 10:31 AM by Gregory Lafrance

    popup problem

    thephantom6969 Level 1
      I have created a popup on an app. and it works great. I then link the popup from a tree and when I try the popup I get the 1034 type coercion error. What is causing this error?

      Thanks
        • 1. Re: popup problem
          Gaurav J Adobe Employee
          If you compile your app with -debug=true. It should show you a more detailed stack trace with line number of the error.

          • 2. Re: popup problem
            Gregory Lafrance Level 6
            Maybe post simplified code to show the problem.
            • 3. Re: popup problem
              thephantom6969 Level 1
              Here is what I see from the debug

              TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::PopUpManagerImpl@6037b81 to mx.managers.IPopUpManager.
              at mx.managers::PopUpManager$/get impl()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\PopUpManager.as:68]
              at mx.managers::PopUpManager$/createPopUp()[E:\dev\3.0.x\frameworks\projects\framework\src\m x\managers\PopUpManager.as:124]
              at PopUpBook/launchSimplePopup()[E:\FlexProjs2\PopUpBook\src\PopUpBook.mxml:26]
              at PopUpBook/___PopUpBook_Button1_click()[E:\FlexProjs2\PopUpBook\src\PopUpBook.mxml:84]

              • 4. Re: popup problem
                Gregory Lafrance Level 6
                Maybe simplified code that resulted in this error.
                • 5. Re: popup problem
                  thephantom6969 Level 1
                  OK, here it is

                  <?xml version="1.0" encoding="utf-8"?>
                  <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns:explorer="*"
                  pageTitle="College Algebra"
                  initialize="sdk.send();" viewSourceURL="srcview/index.html"
                  backgroundColor="white"
                  layout="vertical"
                  verticalAlign="middle"
                  creationPolicy="auto"
                  xmlns:custom="windows.*"
                  >
                  <mx:Style>
                  TabNavigator {
                  }

                  Tab {
                  corner-radius: 8;
                  fill-colors: #0066ff, #f6eeee;
                  }

                  Tree {
                  indentation: 17;
                  open-duration: 123;
                  font: 20;
                  }
                  </mx:Style>
                  <mx:Script>
                  <![CDATA[


                  public function treeChanged(event:Event):void
                  {
                  var nodeApp:String = compLibTree.selectedItem.@app;
                  if (nodeApp != null && nodeApp != "")
                  {
                  swfLoader.loadApp(nodeApp + ".swf");
                  // vs.loadSource(nodeApp, compLibTree.selectedItem.@src);
                  }

                  else
                  {
                  compLibTree.expandItem(compLibTree.selectedItem, true, true);
                  }

                  }

                  public function sdkLoaded():void
                  {
                  explorerTree = XML(sdk.lastResult.node);
                  charts.send();
                  }

                  public function chartsLoaded():void
                  {
                  //explorerTree.appendChild(charts.lastResult.node);
                  populateTree()
                  }

                  //we don't use data binding because the timing of the charts loading can be off
                  public function populateTree():void
                  {
                  compLibTree.dataProvider = explorerTree;
                  }

                  ]]>
                  </mx:Script>

                  <mx:XML id="explorerTree"/>

                  <mx:HTTPService id="sdk" url="explorer/explorer.xml" resultFormat="e4x" result="sdkLoaded();" fault="//do nothing" />

                  <mx:HTTPService id="charts" url="charts_explorer.xml" resultFormat="e4x" result="chartsLoaded();" fault="populateTree()" />

                  <mx:HDividedBox width="100%" height="100%">
                  <mx:Panel width="30%" height="100%" title="College Algebra">
                  <mx:Tree id="compLibTree" width="100%" height="100%" showRoot="false" labelField="@label"
                  change="treeChanged(event);"/>
                  </mx:Panel>

                  <mx:VDividedBox width="100%" height="100%">
                  <explorer:loaderPanel id="swfLoader" width="805" height="759"/>


                  <mx:VBox width="0%" height="0%" backgroundColor="#FFFFFF" visible="false">
                  <explorer:viewsource id="vs" width="0" height="0"/>

                  </mx:VBox>

                  </mx:VDividedBox>

                  </mx:HDividedBox>
                  </mx:Application>

                  The problem occurs the second time I come back to the popup. Works the first time.
                  • 6. Re: popup problem
                    Gregory Lafrance Level 6
                    I don't have the code for explorer:loaderPanel and explorer:viewsource