0 Replies Latest reply on Sep 20, 2007 4:38 AM by manicati

    Error: Error #1023: Stack overflow occurred.

    manicati
      This is the code of my Flash component for Flex.
      It loads 2 images, one with a "Loader" and the other with a "UILoader" and a progressbar.

      When the completeHandler function is executed, the error message " Error #1023: Stack overflow occurred." appears. (The whole message is a the end of the Post)
      The code line which does this error is: ImageContainer2.addChild(myUILoader2);
      When I take it away, no error anymore, but no image too!


      package {

      import flash.display.*
      import flash.text.*
      import mx.flash.UIMovieClip;
      import flash.net.URLRequest;
      import flash.events.*;
      import fl.containers.UILoader;
      import fl.controls.Label;
      import fl.controls.ProgressBar;
      //import fl.controls.progressBarClasses.*;



      public class mcbigImage extends UIMovieClip
      {

      // Define public setter method.
      [Bindable (event="bgImageChanged")]
      [Event('bgImageChanged')]
      [ChangeEvent("change")]
      public function set bgImage(img:String):void
      {
      var ldr:Loader = new Loader();
      var url:String = img;
      var urlReq:URLRequest = new URLRequest(url);
      ldr.load(urlReq);
      this.ImageContainerMirror.addChild(ldr);
      dispatchEvent(new Event("bgImageChanged"));
      //this.testTXT.text = String(ldr.content);
      }

      [Bindable (event="bigImageChanged")]
      [Event('bigImageChanged')]
      [ChangeEvent("change")]
      public function set bigImage(img:String):void
      {
      ImageLoader.visible = true;
      var myUILoader2:UILoader = new UILoader();
      myUILoader2.autoLoad = true;
      myUILoader2.source = img;
      myUILoader2.scaleContent = false;
      myUILoader2.load();
      ImageContainer2.addChild(myUILoader2);

      var myProgressBar:ProgressBar = new ProgressBar();
      myProgressBar.source = myUILoader2;
      myProgressBar.move(218, 147);
      myProgressBar.addEventListener(Event.COMPLETE, completeHandler);
      ImageLoader.addChild(myProgressBar)

      function completeHandler(event:Event):void
      {
      myProgressBar.removeEventListener(Event.COMPLETE, completeHandler);
      ImageLoader.visible = false;

      }
      dispatchEvent(new Event("bigImageChanged"));

      }
      }
      }

      This is the whole error message:

      Error: Error #1023: Stack overflow occurred.
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.managers::SystemManager/mx.managers:SystemManager::Stage_resizeHandler()[C:\dev\flex_2 01_gmc\sdk\frameworks\mx\managers\SystemManager.as:2429]
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()