0 Replies Latest reply on Jan 16, 2008 3:45 PM by RTCXi

    Error 1151: A conflict exists with definition win in namespace internal

    RTCXi Level 1
      Hello,

      I am trying to create a link to two popup windows in my flex application with the following code.

      <?xml version="1.0" encoding="utf-8"?>
      <!--Application Initialization -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" width="850" height="750"
      cornerRadius="10" borderColor="#000000" backgroundGradientColors="[#1b3434, #000000]">
      <mx:Model id="IMSAI_client">
      <client>
      <clientName>IMSAI Microcomputers and Fischer-Freitas Company</clientName>
      <industry>Computer Manufacturing</industry>
      <description>Information Technology</description>
      </client>
      </mx:Model>
      <!--IMSAI Popup-->
      <mx:Script>
      <![CDATA[
      import mx.managers.PopUpManager;

      [Bindable]
      18. private var win:IMSAI;

      private function init():void{}

      private function createPopup():void{
      23. win=IMSAI(PopUpManager.createPopUp(this,IMSAI,true));
      win.title = 'IMSAI.Net';
      win.x = -500;
      win.y = 0;
      customMove.end();
      customMove.play();



      }
      ]]>

      </mx:Script>
      <mx:Style>
      TitleWindow {
      borderStyle:solid;
      borderThickness:2;
      }
      </mx:Style>

      <mx:Parallel id="customMove" target="{win}">
      <mx:Move duration="2000" xTo="{(stage.width - win.width) / 2}" yTo="{(stage.height - win.height) / 2}" />
      <mx:WipeDown duration="2000" />
      </mx:Parallel>
      <!--New Popup-->
      <mx:Script>
      <![CDATA[
      import mx.managers.PopUpManager;

      [Bindable]
      53. private var win:Horse;

      private function inits():void{}

      private function createPopups():void{
      win=Horse(PopUpManager.createPopUp(this,Horse,true));
      win.title = 'Horse';
      win.x = -500;
      win.y = 0;
      customMove.end();
      customMove.play();



      }
      ]]>

      </mx:Script>
      <mx:Style>
      TitleWindow {
      borderStyle:solid;
      borderThickness:2;
      }
      </mx:Style>

      <mx:Parallel id="customMove2" target="{win}">
      <mx:Move duration="2000" xTo="{(stage.width - win.width) / 2}" yTo="{(stage.height - win.height) / 2}" />
      <mx:WipeDown duration="2000" />
      </mx:Parallel>


      I verified that the code works with one window, but when I try to use the code to link to a second window I get the 1151: error message during compile on line 53. It seems to center around win:Horse. win:Horse in intended for the second popup, much like win:IMSAI is intended for the first popup. I changed the names of the variables in the second half of the code so it would not produce the same window or call the same variables. However, when I change the names in the second half of the code that is for a second popup, I get three errors for the top half of the code instead of the single 1151 error for all of the code.

      When I change the name of the variables for the second half to prevent it from calling the same window, I get the following errors in the first half of the code.

      Line:18: 1046: Type was not found or was not a compile-time contact:IMSAI.
      Line 23: 1180: Call to a possibly undefined method: IMSAI
      Line 23: 1067: Implicit coersion of a value of the type mx:controls: Button to an unrelated class.

      However, when I leave everything the same in both halves, I only get the 1151 error on line 53.

      Help resolving this would be greatly appreciated. Please be aware that without the second half of code, the first half works perfectly fine. It is just when you try to use the same code again to generate a popup with a different variable name that it gives problems. Thank you again.