Trying to get my head around using the dictionary object. I think it may solve my problem.
I want to reference paper vision planes which are instances of the Plane Papervision class.
Originally i tried having all my planes in an array and then looping through the array to apply a tween to each plane, but I was getting either a string instead of the actual object, or getting the value for the plane object which is basically its coordinates in the papervision scene.
I decided that what I need is to use the dictionary object to store my planes in (as objects) and reference them with a for loop.
This appeared to work (for one plane, the last plane in the dictionary) and then it halts completely. I try to trace out the value and i get “null = 4: x:307 y:0 z:0”.
enough jibber jabber, here’s the code and hopefully you can get an idea of what i’m trying to do:
function threeDout():void
{
var bl:BlurFilter = new BlurFilter(3,3,1); //blur view port slightly
viewport.filters = [bl];
for(var i:* in homePlanes)
{
trace(i+" = "+homePlanes*);
Tweener.addTween(homePlanes*,{rotationX:540, rotationY:360, z:300, y:plane1yOut, x:plane1xOut, alpha:0, transition:"easeInOutQuad",time:1.5})
}
}
var homePlanes:Dictionary = new Dictionary();
var p1:Object;
var p2:Object;
var p3:Object;
homePlanes[p1] = plane1; //plane1, plane2, plane3 are papervision planes and if i use tweener with their variable names directly, they respond perfectly.
homePlanes[p2] = plane2;
homePlanes[p3] = plane3;
any help from the real programmers (i am designer who knows enough code to be dangerous) here would be incredible guys… i’m ready to light myself on fire!