Property name expected in GetProperty

Well I'm very much so a beginner and this is my first time working with relatively advanced actionscript.  As expected, I've run across a problem that I need help with.  Below is the script I'm working with:

if (75>_rotation) {
      setProperty("", Rotation, Int(angle));
else if(75<_rotation-1) {
      setProperty("", Rotation, Int(angle));

And following is the error it throws:

Symbol=Animated Needle, Layer=Actions, Frame=1: Line 3: Property name expected in GetProperty.
           setProperty("", Rotation, Int(angle));

Symbol=Animated Needle, Layer=Actions, Frame=1: Line 7: Property name expected in GetProperty.
           setProperty("", Rotation, Int(angle));

Does anyone know what I'm doing wrong?  Any help would be greatly appreciated.

Thanks in advance,
Who is Participating?
moduloConnect With a Mentor Commented:
PAQed with points refunded (500)

Community Support Moderator
setProperty(target:Object, property:Object, value/expression:Object) : Void

I thunk you are setting a property of something...I think here you are trying to rotate the needle..( I asume needle is a movie the way to do this is..
setProperty(_root.needle, _rotation , Int(angle));

//You dont have a property as "Rotation"...that should be "_rotation"
there's no need to use setproperty for what you're doing; this is more than sufficient

movieclipinstancename._rotation = whatevervalue;

if you wish to increment or decrement, use standard operators, but remember that rotation isn't entirely scalable (i.e., if you set _xscale to 1000 it makes the object 10 times larger; if you set _alpha to 20, it sets the opacity to one-tenth: both logical and sensical.  if you set the _rotation of an object to a value greater than a particular radix (unsure of my verbiage there), the results might be unpredictable...

also a lot of ppl try to 'flip' with rotation - this is actually accomplished using scaling - if you want to flip something horizontally (like turning a page), use _xscale = -100; if you wish to flip it vertically: _yscale =-100;

hth gl
Goddess6942Author Commented:
I actually managed to figure out how to get the script I'm using to work for MX:

var needle = 0;
if (needle>_rotation) {
        angle=(needle - _rotation)*.2+_rotation+1;
} else if (needle<_rotation - 1) {
        angle=_rotation-(( _rotation-needle)*.2)-1;

Now the only problem I'm having is this script seems to only allow for a rotation of 180 degrees.  Anything larger than 180 degrees causes the needle to rotate 360 degrees continuously.  Any ideas as to how that can be fixed?


All Courses

From novice to tech pro — start learning today.