# Actionscript 3.0 1120: Access of undefined property root.?

**URL:** <https://forum.kirupa.com/t/actionscript-3-0-1120-access-of-undefined-property-root/326239>\
**Category:** Uncategorized\
**Created:** [December 1, 2011, 8:55am UTC](https://forum.kirupa.com/t/actionscript-3-0-1120-access-of-undefined-property-root/326239 "2011-12-01T08:55:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![violetrocco](https://avatars.discourse-cdn.com/v4/letter/v/c67d28/32.png) [@violetrocco](https://forum.kirupa.com/u/violetrocco)\
**Post date:** [December 1, 2011, 8:55am UTC](https://forum.kirupa.com/t/actionscript-3-0-1120-access-of-undefined-property-root/326239/1 "2011-12-01T08:55:25Z")

</div>

[h=1][/h] Here’s the function with the line with the error:

public static function getViewX():Number  
{  
return -MovieClip(root).x;  
}

[My blog](http://birthday---poems.blogspot.com/)
