Created
June 4, 2012 08:43
-
-
Save nowri/2867286 to your computer and use it in GitHub Desktop.
Using-the-same-mediator-with-more-than-one-view.as
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -------------------------------------------------------------------------- | |
// | |
// 1つのMediatorに複数のViewComponentを割り当てる | |
// | |
// -------------------------------------------------------------------------- | |
// -------------------------------------------------------------------------- | |
// 1. ステージ上に配置された任意のMovieClipに割り当て | |
// -------------------------------------------------------------------------- | |
mediatorMap.mapView(MovieClip, BaseButtonMediator, null, false); | |
//第4引数をfalseにしないと全てのMovieClipにAddToStageのタイミングで適用されてしまう。 | |
mediatorMap.createMediator(mc1); | |
mediatorMap.createMediator(mc2); | |
mediatorMap.createMediator(mc3); | |
// -------------------------------------------------------------------------- | |
// 2. ステージ上に配置された同じ基本クラスを持つDisplayObjectContainer継承クラスに割り当て | |
// -------------------------------------------------------------------------- | |
mediatorMap.mapView(BaseButton, BaseButtonMediator); | |
mediatorMap.mapView(getQualifiedClassName(btn1), BaseButtonMediator, BaseButton); | |
mediatorMap.mapView(getQualifiedClassName(btn2), BaseButtonMediator, BaseButton); | |
mediatorMap.createMediator(btn1); | |
mediatorMap.createMediator(btn2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment