It's not working in either. I will try as you suggest. Thanks!
On Fri., 12 Mar. 2021, 22:28 Greg Dove, <[email protected]> wrote:
>
> Hi David,
>
> Is it working in debug build, but perhaps not in release?
>
> You might need to include a concrete reference to the class. If
> event.common.CommonEvent is not actually present in the build, then the
> reflective access to the class will fail. you may need to force a reference
> to the class in the build. I often do this in something like this at
> startup:
>
> package {
> import event.common.CommonEvent;
> public class ForceCompilation {
>
> public static function get forcedClasses():Array{
> return [CommonEvent, /* add others as needed */];
> }
> }
>
> }
>
>
> Then in the applicationComplete or preInit or some startup part of the
> sequence:
> var forcedClasses:Array = ForceCompilation.forcedClasses;
>
> See if something like that helps... good luck.
> Greg
>
>
> On Sat, Mar 13, 2021 at 9:59 AM David Slotemaker de Bruine <
> [email protected]> wrote:
>
>> Hi all,
>>
>> I have the following defined in my App.mxml
>>
>> <crux:CruxConfig
>>
>> eventPackages="event.common.*,event.usuario.*,event.cliente.*,event.varpedido.*"
>>
>> viewPackages="view.*,view.cliente.*,view.usuario.*,view.varpedido.*"/>
>> </crux:config>
>>
>> But I am getting this error when running the app:
>>
>> Uncaught Error: Could not get a reference to class for
>> CommonEvent.EVENT_CARGAR_CONFIGURACIONES. Did you specify its package in
>> cruxConfig::eventPackages?
>>
>> Events for event.usuario.*,event.cliente.* are working fine. What could I
>> be missing?
>>
>>
>> The Event class is:
>>
>> package event.common
>> {
>> import org.apache.royale.events.Event;
>>
>> public class CommonEvent extends Event
>> {
>> public static const
>> EVENT_CARGAR_CONFIGURACIONES:String = "eventCargarConfiguraciones";
>> public static const
>> EVENT_CARGAR_PROMOTORES_DED_ELEGADO:String =
>> "eventCargarPromotoresDeDelegado";
>>
>> public var id:Number;
>> public var idDelegado:Number;
>>
>> public function CommonEvent( type:String )
>> {
>> super( type, true );
>> }
>> }
>> }
>>
>> Cheers,
>>
>> David
>>
>