View Full Version : getbounds() returns undefined
kidap
03-06-2008, 08:03 PM
I am using flash 8 but publishing to flash 6. When I test the following code by publishing to flash player 6, give me proper x and y min and max values. When I publish to 7 or higher I get "undefined". The getBounds() function does not appear to be depricated. Any ideas?
var getlimits = instMask.getBounds(this._parent);
jdurand
03-10-2008, 12:57 AM
test is a 300 x 200 movie clip sitting at 0,0
Both of these methods worked for me in 8
var getlimits = test.getBounds(this);
trace (getlimits.xMax) ; //Returns 300
trace (getlimits.xMin) ; //Returns 0
trace (getlimits.yMax) ; //Returns 200
trace (getlimits.yMin) ; //Returns 0
for (var i in getlimits) {
trace(i+" --> "+getlimits[i]);
}
//Returns
//yMax --> 200
//yMin --> 0
//xMax --> 300
//xMin --> 0
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.