Dispatching custom event from a custom component

Problem:

In Game.mxml File has "pref_event" Event

[Event(name="pref_event", type="PrefEvent")]

but your dispatching PrefEvent.GAME_CLICKED ("game_clicked").

Solution:

You must dispatch the right event for this.

dispatchEvent( new PrefEvent("pref_event",gameid, true) );  

[Event(name="pref_event", type="PrefEvent")] != new PrefEvent(PrefEvent.GAME_CLICKED, gameid, true)

The name of the events are not the same.

You should write this in your Game.mxml file :

<fx:Metadata> 
        [Event(name="game_clicked", type="PrefEvent")] 
</fx:Metadata>

And this in your main file :

<comps:Game id="game" x="0" y="0" game_clicked="gameClicked(event)" />

See here for further informations...