1 Reply Latest reply on Mar 8, 2012 9:21 AM by Flex harUI

    Runtime Error 1009 After Converting from Flex 3.6 to 4.5.1

    lee704 Level 1

      I am in the process of converting my application from SDK 3.6 to 4.5.1.  The process is going smoothly thanks to the many resources out there including Greg Lafrance's series http://www.adobe.com/devnet/flex/articles/migrating-flex-apps-part1.html

       

      I am now getting an error while the application is loading in the browser.  The error text is:

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

                at main/initApp()...

       

      The error occurs in the AS code where I am attempting to get the URL from the player using the mx.utils.URLUtil library.  In particular, I am setting a global variable in my app to the URL of the visitor.  The specific code for this is:

       

      this.stServerName=URLUtil.getServerName(mainApp.url);

       

      Is URLUtil still in use in Flex 4.5.1?  If not, is there another way to get the server name from the host?

       

      Thanks!

      Lee