Property name expected in GetProperty

Posted on 2004-11-12
Last Modified: 2012-06-27
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,
Question by:Goddess6942
    LVL 6

    Expert Comment

    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"

    Expert Comment

    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

    Author Comment

    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?



    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
    The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
    The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now