How do i access view3d view, scene, lightpicker and all the other properties of Away3d in Starling.
/**
* Constructor
*/
public function Away3DTemplate()
{
addEventListener(Event.ADDED_TO_STAGE, addedToStage);
}
/**
* Global initialise function
*/
private function addedToStage(e:Event):void
{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
if (STARLING_ENABLED)
initProxies();
else
onContextCreated(null);
}
/**
* Initialise the Stage3D proxies
*/
private function initProxies():void
{
// Define a new Stage3DManager for the Stage3D objects
stage3DManager = Stage3DManager.getInstance(stage);
// Create a new Stage3D proxy to contain the separate views
stage3DProxy = stage3DManager.getFreeStage3DProxy();
stage3DProxy.addEventListener(Stage3DEvent.CONTEXT3D_CREATED, onContextCreated);
stage3DProxy.antiAlias = 8;
stage3DProxy.color = 0x0;
}
private function onContextCreated(e:Stage3DEvent):void
{
initEngine();
if (STARLING_ENABLED)
initStarling();
initLights();
initMaterials();
initObjects();
initListeners();
initGVC();
buildTerrain();
initMain();
}
private function initMain():void
{
/*var stage1Panel:Stage1Panel = new Stage1Panel(scene, view, lightPicker);
addChild(stage1Panel);
//stage1Panel.x = stage.stageWidth/2;
TweenMax.fromTo(stage1Panel, 0.5, { alpha:0, x:-50 }, { alpha:1, x:0 } );*/
}
private function initStarling():void
{
userInterface = new Starling(Interface, stage, stage3DProxy.viewPort, stage3DProxy.stage3D);
userInterface.start();
//this.stage.addEventListener(Event.RESIZE, stage_resizeHandler, false, int.MAX_VALUE, true);
}
now how can i acces the variables created here by the userInterface class which is a starling class???
at the moment i have got a global variables class which stores the view and respective variables of away3d and then i access it from starling, which i don’t think is the right way to do it?