Domanda

Sto cercando di mediare la classe principale dell'applicazione (la 'classe Document' di un Flash * .fla progetto)

Ho questo sulla avvio contesto di applicazione ():

... mediatorMap.mapView (MyApplication, MyApplicationMediator); mediatorMap.createMediator (ContextView);

Il MyApplicationMediator:

public class MyApplicationMediator si estende mediatore {
[Inject]
pubblica vista var: MyApplication;
public override Funzione onRegister (): void {
trace ( "Mi sono registrato!");
}

onRegister () viene chiamato, ma vista è nullo. Anche quando provo ad aggiungere i eventListeners ottengo un errore di riferimento null.

È stato utile?

Soluzione

This is generally a result of compiling robotlegs from source and not having keep-as3-metadata +=Inject as a compiler option.

I think that your createMediator call is superfluous. The contextView is a "special" case in that it is already added to the stage so by default when the mediator is set via mapView it gets created automatically.

This Common Problems section of the wiki is a pretty decent resource.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top