I am working on a project right now that I have been able to use the new FlashBuilder beta to develop on. I chose this platform because Adobe has made it all too easy to integrate with .NET web services. You can literally just point to a WSDL and FlashBuilder will generate all the code behind for you. What is really cool and a huge time saver is that you can bind controls back to the pre-generated CRUD operations from the web service. I switch the page I’m working on to design mode and then drag a form on the canvas. A simple right click to access the “Bind” operation and voila! You’re ready to deploy! Not really…but man it gets you close.
Because I am also developing a mapping application using ESRI’s FlexViewer framework, I have to integrate my CRUD forms in to the ESRI environment. Needless to say, this caused all kinds of problems! When I created a project outside of the FlexViewer project, everything worked perfectly! As soon as I tried to integrate it in to FlexVewer as a floating widget…Kaboom! I got the dreaded 1065 error. If you are reading this, it’s probably because you came across this error as well and found this page on the interwebs.
Error #1065: Variable x is not defined.
This error is a bit misleading because “Variable x” is actually a class that when integrated in to the FlexViewer framework get pushed out of scope or what some call, “Optimized out”. To get your code running in FlexViewer, you can’t just declare each variable/class as public! You have to declare each of them in Index.mxml which is the Application root. Please stick with the following syntax in order for your code to work properly.
1 | public var d:services.distributionlist.RegionUser = new services.distributionlist.RegionUser(); |
Doing this in Index.mxml will make your class public enough to be used throughout the entire application and you won’t get the #1065 error any longer. I certainly can’t take all the credit for this. I have to Google the crap out of this and came across Simon’s post here. Hats off to you Simon for helping me out!!!
More from Adam Estrada
- Customizing config.xml in the ESRI FlexViewer
- Open Street Map (take 1)
- How to copy music from your iPod to your iPhone
- Oracle Spatial and USER_SDO_GEOM_METADATA
- SpatiaLite and Smart Phones