0 Replies Latest reply on May 5, 2008 7:42 AM by paulhergh

    using comboBox in Module

    paulhergh
      Hi!
      I have the following code that works just fine (combo.mxml):
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application backgroundColor="0xE6E6E6" xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" xmlns="*" themeColor="0x0000B0">

      <mx:Script>
      <![CDATA[
      public function initYearArray():void {
      var yearArray:Array=new Array();
      var thisYear:Number=new Date().getFullYear();
      var year:Number;
      for (year=0;year<thisYear-1920;year++) {
      yearArray[year]=String(thisYear-year);
      }
      yearArray.unshift("");
      S_PER_DTENAISANNEE.dataProvider=yearArray;
      }
      ]]>
      </mx:Script>

      <mx:ComboBox styleName="ComboBox" id="S_PER_DTENAISANNEE" text="" initialize="initYearArray();"/>

      </mx:Application>

      What I'm trying to do is include this code into a module that is loaded in another mxml file, using the following code:


      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" backgroundColor="0xE6E6E6" themeColor="0x0000B0">
      <mx:Script>
      <![CDATA[
      import mx.modules.*;
      ]]>
      </mx:Script>

      <mx:ModuleLoader url="combo.swf" id="moduleTop" width="100%"/>
      </mx:Application>


      I tried changing mx:Application into mx:Module, but it doesn't seem to work.

      Please help me, I don't know what I'm doing wrong....

      Tnx, Paul