Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Can't access the arrays in object

New Here ,
Mar 25, 2015 Mar 25, 2015

Hey I realise probably it's silly question, but I can't manage to access these arrays for example `__motion_Door_8.addPropertyArray("x", [0]);`. I want to access them so I could reverse the array and have my animation playing reversed, but I simply couldn't access them

__motion_Door_8.x
__motion_Door_8["x"]

none of the ways worked and it returned me an error that such a properties do not exist.

public function rotationDoor(instName:DisplayObject, times:int, reversed:Boolean):void{

       var __motion_Door_8:MotionBase;

       if(__motion_Door_8 == null) {

            __motion_Door_8 = new MotionBase();

           __motion_Door_8.duration = 37;

            // __motion_Door_8.overrideTargetTransform();

            __motion_Door_8.addPropertyArray("x", [0]);

            __motion_Door_8.addPropertyArray("y", [0]);

            __motion_Door_8.addPropertyArray("scaleX", [1.000000]);

            __motion_Door_8.addPropertyArray("scaleY", [1.000000]);

            __motion_Door_8.addPropertyArray("skewX", [0]);

            __motion_Door_8.addPropertyArray("skewY", [0]);

            __motion_Door_8.addPropertyArray("z", [0]);

            __motion_Door_8.addPropertyArray("rotationX", [0]);

            __motion_Door_8.addPropertyArray("rotationY",             [0,1.11111,2.22222,3.33333,4.44444,5.55556,6.66667,7.77778,8.88889,10,11.1111,12.2222,13.3333,14.4444,15.5556,16.6667,17.7778,18.8889,20,21.1111,22.2222,23.3333,24.4444,25.5556,26.6667,27.7778,28.8889,30,31.1111,32.2222,33.3333,34.4444,35.5556,36.6667,37.7778,38.8889,40]);

            __motion_Door_8.addPropertyArray("rotationZ", [0]);

            __motion_Door_8.addPropertyArray("blendMode", ["normal"]);

            __motion_Door_8.addPropertyArray("cacheAsBitmap", [false]);

            __motion_Door_8.addPropertyArray("opaqueBackground", [null]);

            __motion_Door_8.addPropertyArray("visible", [true]);

            __animFactory_Door_8 = new AnimatorFactory3D(__motion_Door_8);

            __animFactory_Door_8.addTarget(instName, times);

       }

  }

TOPICS
ActionScript
263
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 25, 2015 Mar 25, 2015

__motion_Door_8 is a MotionBase instance:  use the MotionBase setValue method.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2015 Mar 25, 2015

hm, I found that there are setValue and getValue, but that works just for single frame value and what i want to do is reverse the values in this array, so it would start at 40 and finish to 0

__motion_Door_8.addPropertyArray("rotationY", [0,1.11111,2.22222,3.33333,4.44444,5.55556,6.66667,7.77778,8.88889,10,11.1111,12.2222,13.3333,14.4444,15.5556,16.6667,17.7778,18.8889,20,21.1111,22.2222,23.3333,24.4444,25.5556,26.6667,27.7778,28.8889,30,31.1111,32.2222,33.3333,34.4444,35.5556,36.6667,37.7778,38.8889,40]); 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 25, 2015 Mar 25, 2015

i don't think you can change the start value, but:

var reverseA:Array = [0,1.11111,2.22222,3.33333,4.44444,5.55556,6.66667,7.77778,8.88889,10,11.1111,12.2222,13.3333,14.4444,15.5556,16.6667,17.7778,18.8889,20,21.1111,22.2222,23.3333,24.4444,25.5556,26.6667,27.7778,28.8889,30,31.1111,32.2222,33.3333,34.4444,35.5556,36.6667,37.7778,38.8889,40].reverse();


for(var i:int=1;i<reverseA.length;i++){

yourmotion.setValue(i,'rotationY',reverseA);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2015 Mar 25, 2015

I guess I get it and to change values reverse() method does what I need. Also I wanted to ask what is the best way to make animations inside Flash Professional, or you simply pure code it with tweens and stuff? Because I found this option "Copy Motion to Actionscript 3.0" from timeline animation, but it doesn't look used so much and also in my eyes it lacks some features.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 25, 2015 Mar 25, 2015
LATEST

i use code and i prefer greensocks' tweenlite and tweenmax, GreenSock | TweenLite

(p.s when using the adobe forums, please mark helpful/correct responses, if there are any.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines