Designer (or Viewer) as Module / Flex warnings
Posted: Tue Nov 29, 2011 4:36 am
Hi,
we just tried to put the designer or viewer in a Flex module for optimizing the loading and the memory usage with this code in the main application:
My question:
- Can we ignore this? I don't think so ...
- Can we make a workaround without packing the full code in the main application?
Martin
we just tried to put the designer or viewer in a Flex module for optimizing the loading and the memory usage with this code in the main application:
The module is simple:import mx.core.IFlexDisplayObject;
import mx.core.IVisualElement;
import mx.events.ModuleEvent;
import mx.modules.IModuleInfo;
import mx.modules.ModuleManager;
import mx.messaging.messages.*;
import test.Itestreport;
private var reporter:IModuleInfo;
[Bindable]
private var reporterinstance:Itestreport;
protected function loadreport():void {
reporter = ModuleManager.getModule("test/testreport.swf");
reporter.addEventListener(ModuleEvent.READY, modEventHandler);
reporter.load();
}
private function modEventHandler(e:ModuleEvent):void {
// Add an instance of the module's class to the
// display list.
reporterinstance = reporter.factory.create() as Itestreport;
testvg.addElement(reporterinstance as IVisualElement);
}
private function runreport():void {
reporterinstance.design();
}
All works, but we get a debug warning:import stimulsoft.report.StiReport;
import stimulsoft.report.design.StiDesignerFx;
private function init():void {
StiDesignerFx.initialize();
}
public function design():void {
var report: StiReport = new StiReport();
report.design();
}
If we put the initialize code in the main application, no warnings appear, but we have the full package size in the main application, what we want to prevent.warning: The class mx.messaging.config.ConfigMap has been used in a call to net.registerClassAlias() in _testreport_FlexInit. This will cause test:testreport to be leaked. To resolve the leak, define mx.messaging.config.ConfigMap in the top-level application.
warning: The class mx.messaging.messages.AcknowledgeMessage has been used in a call to net.registerClassAlias() in _testreport_FlexInit. This will cause test:testreport to be leaked. To resolve the leak, define mx.messaging.messages.AcknowledgeMessage in the top-level application.
warning: The class mx.messaging.messages.AcknowledgeMessageExt has been used in a call to net.registerClassAlias() in _testreport_FlexInit. This will cause test:testreport to be leaked. To resolve the leak, define mx.messaging.messages.AcknowledgeMessageExt in the top-level application.
warning: The class mx.messaging.messages.AsyncMessage has been used in a call to net.registerClassAlias() in _testreport_FlexInit. This will cause test:testreport to be leaked. To resolve the leak, define mx.messaging.messages.AsyncMessage in the top-level application.
warning: The class mx.messaging.messages.AsyncMessageExt has been used in a call to net.registerClassAlias() in _testreport_FlexInit. This will cause test:testreport to be leaked. To resolve the leak, define mx.messaging.messages.AsyncMessageExt in the top-level application.
warning: The class mx.messaging.messages.CommandMessage has been used in a call to net.registerClassAlias() in _testreport_FlexInit. This will cause test:testreport to be leaked. To resolve the leak, define mx.messaging.messages.CommandMessage in the top-level application.
warning: The class mx.messaging.messages.CommandMessageExt has been used in a call to net.registerClassAlias() in _testreport_FlexInit. This will cause test:testreport to be leaked. To resolve the leak, define mx.messaging.messages.CommandMessageExt in the top-level application.
warning: The class mx.messaging.messages.ErrorMessage has been used in a call to net.registerClassAlias() in _testreport_FlexInit. This will cause test:testreport to be leaked. To resolve the leak, define mx.messaging.messages.ErrorMessage in the top-level application.
warning: The class mx.messaging.messages.HTTPRequestMessage has been used in a call to net.registerClassAlias() in _testreport_FlexInit. This will cause test:testreport to be leaked. To resolve the leak, define mx.messaging.messages.HTTPRequestMessage in the top-level application.
warning: The class mx.messaging.messages.MessagePerformanceInfo has been used in a call to net.registerClassAlias() in _testreport_FlexInit. This will cause test:testreport to be leaked. To resolve the leak, define mx.messaging.messages.MessagePerformanceInfo in the top-level application.
My question:
- Can we ignore this? I don't think so ...
- Can we make a workaround without packing the full code in the main application?
Martin