Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CS4 - 3d properties not working on custom extended classes

Status
Not open for further replies.

maguskrool

Technical User
Dec 11, 2006
77
0
0
PT
Hello. I've created a simple custom class that extends Sprite and called it Sprite2. It has no specific methods nor is it in any way different from Sprite, it just extends it. When I create instances of Sprite2 and try to access properties like rotationX/Y/Z or z, I get an error saying "1119: Access of undefined probably property...". If I insert a simple trace (z); in the constructor, I get "1120: Access of undefined property z..."

I don't understand why this happens, is this some CS4 bug? I have installed the latest updates.

Here is the code I used:
Code:
//Sprite2.as
package com.stuff {
	
	import flash.display.Sprite;
	
	public class Sprite2 extends Sprite {
		
		public function Sprite2():void {
			
		}
	}//End of class.
}//End of package.

//.fla
import com.stuff;
var mySprite:Sprite2 = new Sprite2();
trace (mySprite.x); //returns 0
trace (mySprite.z); //error: 1119: Access of probably undefined property z...

I appreciate all the help.

 
I haven't installed CS4 yet so I cannot test right now, but you need to set "z" explicitly to any number other than 0 to auto-create a Matrix3D object - that's my understanding.

Kenneth Kawamoto
 
Thanks Kenneth. Another user solved this for me. The problem was I was still exporting to Flash Player 9, because I assumed Flash would export to FP10 by default and so I didn't check. Plus, I had tested tweens with z and rotationX/Y/Z and they worked, only not when applied to instances of extended classes. As soon as I began exporting to Flash Player 10, it all worked fine.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top