Hello all,
I'm writing some classes to simulate 3d movement of MCs.
I took and old class I made to simulate the same with letters. It was a class which extended the MovieClip class.
Now I decided to make it more general and made it a standalone class wich creates a movieclip that I can fill from outside usin public methods.
The problem is that I cant access the _r (3d position) or any other property from inside an onEnterFrame attached to the movieclip which contains the 3d MC
This is the code for a random movement method of the class:
ActionScript Code:
public function triniRandomMove(){
var i : Number;
var a_mod : Number = 0.7;
var v_mod : Number = 1.0;
var r_max : Array = [_boxWidth, _boxHeight,_boxDepth];
for (i=0;i<=2;i++){
_r[i] = Math.random()*r_max[i];
_v[i] = (Math.random()*2 - 1)*v_mod;
}
target_mc.onEnterFrame = function(){
for (i=0;i<=2;i++){
_a[i] = (Math.random()*2 - 1)*a_mod;
}
trace(_a);
mruaMove_frame();
checkBoundaries();
set3dPosition();
}
}
Where _r, _v, and _a are private properties of the class. The trace(_a); only spits 'undefined'.
Any idea of what's the solution?
Glantucan