Cast.bitmapTexture not working in Flash IDE

Software: Away3D 4.x

guts, Newbie
Posted: 25 March 2013 01:14 PM   Total Posts: 3

Hello,
I’m using the Flash CS6 IDE and am trying to set a texture like so:

[Embed(source='textures/floor_diffuse.jpg'mimeType='application/octet-stream')]
var FloorDiffuse:Class;
var 
planeMaterial = new TextureMaterial(Cast.bitmapTexture(FloorDiffuse));
var 
_plane:Mesh = new Mesh(new PlaneGeometry(700,700),planeMaterial); 

What I get is a long error message followed by a load of junk characters which I assume is the texture.

ErrorCan't cast to BitmapTexture: ÿØÿàJFIFÿÛCÿÛC............  
 at away3d.utils::Cast$/bitmapTexture()
 at away3d_test_fla::MainTimeline/frame1() 

What is the correct way to embed and cast a bitmapTexture in the Flash IDE?

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X