Hello Away3D community,
I’m currently using the book: The Essential Guide to 3D in Flash and I’m stuck at chapter 4.
The problem is I have converted a 3ds model to as3. But I need to import it into the class. I’m using the script provided with the book. But I’m getting an error. It doesn’t seem to recognise _view
Here is the script I’m using:
package
{
import away3d.core.base.*;
import away3d.lights.*;
import away3d.materials.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import models.common.PlanetWinter;
public class pictor extends MovieClip
{
public function pictor()
{
super();
}
protected function _createScene()
{
var material:ShadingColorMaterial = new ShadingColorMaterial(0x888888);
var planetWinter:PlanetWinter = new PlanetWinter();
planetWinter.material = material;
planetWinter.x = (Math.random()-0.5) * 512
planetWinter.y = (Math.random()-0.5) * 512
planetWinter.z = (Math.random()-0.5) * 512
_view.scene.addChild(planetWinter);
var light:PointLight3D = new PointLight3D();
light.x = 500;
light.y = 500;
light.z = 0;
_view.scene.addLight(light);
}
}
}
When I run this code I’m getting the following error:
1120: Access of undefined propery _view.
As the error says it seems that he does not recognise _view which I think is weird because I worked before with other scripts from the book.
And there is nothing about it in the Errata
Does anyone can help me with this?