Created
June 15, 2013 13:48
-
-
Save bsideup/5788202 to your computer and use it in GitHub Desktop.
MultiModuleBootstrap test
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
package ru.trylogic.framework.examples.dummy | |
{ | |
import mx.core.ClassFactory; | |
import tl.adapters.nativeDisplayList.NativeBootstrap; | |
import tl.adapters.starling.StarlingBootstrap; | |
import tl.core.IBootstrap; | |
import tl.core.MultiModuleBootstrap; | |
public class Bootstrap extends MultiModuleBootstrap | |
{ | |
public function Bootstrap() | |
{ | |
var starlingBootstrap : StarlingBootstrap = new StarlingBootstrap(); | |
starlingBootstrap.applicationViewFactory = new ClassFactory(ApplicationView); | |
var nativeBootstrap : NativeBootstrap = new NativeBootstrap(); | |
nativeBootstrap.applicationViewFactory = new ClassFactory(ApplicationView); | |
modules = new <IBootstrap>[starlingBootstrap, nativeBootstrap]; | |
} | |
} | |
} | |
import flash.display.BitmapData; | |
import tl.adapters.IDisplayObject; | |
import tl.adapters.IImageAdapter; | |
import tl.view.AbstractView; | |
import tl.view.ViewContainer; | |
import tl.viewController.ViewController; | |
class ApplicationViewController extends ViewController | |
{ | |
use namespace outlet; | |
outlet var image : ImageView; | |
override lifecycle function viewBeforeAddedToStage() : void | |
{ | |
image.component_texture = new BitmapData(100, 100, false, 0xFF0000); | |
image.x = 300 * Math.random(); | |
} | |
} | |
class ImageView extends AbstractView implements IImageAdapter | |
{ | |
use namespace viewInternal; | |
public function ImageView() | |
{ | |
} | |
override protected function lazyCreateFace() : IDisplayObject | |
{ | |
return bootstrap.createFaceForView(IImageAdapter); | |
} | |
public function set component_texture(value : *) : void | |
{ | |
invalidateProperty("component_texture", value); | |
} | |
public function get component_texture() : * | |
{ | |
return _viewState.component_texture; | |
} | |
} | |
class ApplicationView extends ViewContainer | |
{ | |
public var image : ImageView; | |
public function ApplicationView() | |
{ | |
controllerClass = ApplicationViewController; | |
image = new ImageView(); | |
} | |
override lifecycle function init() : void | |
{ | |
addView(image); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment