Using BitMapCubeTexture

Software: Away3D 4.x

hershey, Newbie
Posted: 23 March 2014 01:55 PM   Total Posts: 1

Hello Everyone,

I was trying to create the same example in Flash instead of Flex/Flash Builder

http://gotoandlearn.com/play.php?id=165 (TimeCode 10:53)

How do I instantiate the Images in Flash. I have the objects in the library and set the linkages

var onec = new one();
var 
twoc = new two();
var 
threec = new three();
var 
fourc = new four();
var 
fivec = new five();
var 
sixc = new six();
  
var 
bct:BitmapCubeTexture = new BitmapCubeTexture(onec.bitmapData,twoc.bitmapData,threec.bitmapData,fourc.bitmapDatafivec.bitmapData,sixc.bitmapData); 


I am getting the following Error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at away3d.textures::BitmapCubeTexture/testSize()
at away3d.textures::BitmapCubeTexture()
at away3d_fla::MainTimeline/frame1()

   

Avatar
theMightyAtom, Sr. Member
Posted: 23 March 2014 07:37 PM   Total Posts: 669   [ # 1 ]

If you take a bitmap in flashCC and set it to “Export for Actionscript” it will already be a BitmapData rather than a bitmap.

So you can write something like: 

var bct:BitmapCubeTexture = new BitmapCubeTexture(new onec(),new twoc(),new threec(),new fourc(), new fivec(), new sixc());

Give that a go smile

Good Luck!

 

   

dyoung, Newbie
Posted: 21 April 2015 11:49 PM   Total Posts: 5   [ # 2 ]

Thank you for this thread. I am having an issue though. I got the program to run without throwing an instantiate error but the cube is not showing up on my stage when I attempt to texture it with SkyBoxMaterial. But it does show up when I use ColorMaterial. Can someone point me in the right direction?

Here is the code.

 

File Attachments
chapter2camera.as  (File Size: 2KB - Downloads: 191)
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X