1 Reply Latest reply on Oct 3, 2006 7:35 AM by kglad

    MovieClip._height listen/watch

      Hi guys,

      I need to monitor the size of a movieClip and I didnt want to use an interval so I thought maybe I can setup up a listener to do it or even use Object.watch to see when the height changes.

      Basically I have a movieClip on Stage which is the holder for all the content on my site and I need to be able to scroll it using the browsers scrollbar. I wanted to be able to change the Stage size of my swf to match the size of my movieClip (which is constantly changing) and so be able to use the browsers scroll bar.

      Nothing I've tried so far has worked so I'm hoping someone here might be able to help.
        • 1. Re: MovieClip._height listen/watch
          kglad Adobe Community Professional & MVP
          the answer is no. in the flash help docs under watch():

          The Object.watch() method cannot watch getter/setter properties. Getter/setter properties operate through lazy evaluation-- the value of the property is not determined until the property is actually queried. Lazy evaluation is often efficient because the property is not constantly updated; it is, rather, evaluated when needed. However, Object.watch() needs to evaluate a property to determine whether to invoke the callback function. To work with a getter/setter property, Object.watch() needs to evaluate the property constantly, which is inefficient.

          Generally, predefined ActionScript properties, such as _x, _y, _width, and _height, are getter/setter properties and cannot be watched with Object.watch().