Error Access Of Undefined Property Resourcemanager
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Flex resourceManager working perfect in one file and not at all in another up vote 0 down vote favorite I'm trying to use resourceManager in Flex for some localization. I'm having a strange problem where it works fine in the first file that I tried it in, but in the second it won't even compile. Both files have import mx.resources.ResourceBundle; at the top and [ResourceBundle("Hurley")] above the class definition. The first one compiles fine, and pulls the text from the resources correctly at runtime. The second file (which is in the same project but a different folder), will not compile, and every mention of resourceManager gives an error of "1120: Access of undefined property resourceManager." For the two different uses: In the file that works: public function SeasonsComboBox() { this.labelFunction = function(obj:Object):String { return resourceManager.getString('Hurley','Season_word') + " " + obj.number; }; } And the file that doesn't work: public function getCarousels(seriesId:String, callback:Function):void { [...] ExternalInterface.addCallback("getCarouselsFailure", function():void { Alert.show(resourceManager.getString('Hurley','CarouselsFailure_text'), "Error", Alert.OK); }); [...] } I can't think of anything different I did in either file. Edit, Solved: resourceManager is defined in all UIComponent subclasses. The file that worked imported ComboBox. The files that didn't don't. In those files, I can make it work by calling: ResourceManager.getInstance() More information here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/resources/IResourceManager.html actionscript-3 flex localization resourcemanager share|improve this question edited Jul 17 '12 at 22:53 asked Jul 17 '12 at 18:54 Ryan Coonan 499 Does one class extend something that has access to the resourceManager, while the other does not? Did you define resourceManager in the second class? With the short
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join http://stackoverflow.com/questions/11529002/flex-resourcemanager-working-perfect-in-one-file-and-not-at-all-in-another the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error 1120: Access of undefined property up vote 0 down vote favorite I have a
ElementsAdobe Dreamweaver Adobe MuseAdobe Animate CCAdobe Premiere ProAdobe After EffectsAdobe IllustratorAdobe InDesignView all communitiesExplore Menu beginsMeet the expertsLearn our productsConnect with your peersError: You don't have JavaScript enabled. https://forums.adobe.com/thread/983630 This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back on and reload this page. http://devgirl.org/2011/03/15/flex-4-localization/ Please enter a title. You can not post a blank message. Please type your message and try again. More discussions in ActionScript 3 All error access CommunitiesAdobe Animate CC - HomeActionScript 3 1 Reply Latest reply on Apr 1, 2012 7:19 AM by kglad 1120:Access of undefined property error ahmetsaid Apr 1, 2012 7:05 AM import flash.net.NetStream; import mx.events.FlexEvent; private const CirrusAddress:String = "rtmfp://p2p.rtmfp.net/"; private const DeveloperKey:String = "mydevkey"; private var nc:NetConnection; private var myPeerID:String; error access of private var recvStream:NetStream; private var myName:NetStream; protected function application1_creationCompleteHandler(event:FlexEvent):void {nc = new NetConnection();nc.addEventListener(NetStatusEvent.NET_STATUS,ncStatus);nc.connect("rtmfp://p2p.rtmfp.net/mydevkey/"); } protected function ncStatus(event:NetStatusEvent):void{myPeerID = nc.nearID;peerIdArea.text = myPeerID; } myName = new NetStream(nc); // ERROR IS HERE---------------------------------------------Description Resource Path Location Type1120: Access of undefined property myName. P2PSample.mxml /P2PSample/src line 30 Flex ProblemDescription Resource Path Location Type1120: Access of undefined property nc. P2PSample.mxml /P2PSample/src line 30 Flex Problem 852Views Tags: none (add) This content has been marked as final. Show 1 reply 1. Re: 1120:Access of undefined property error kglad Apr 1, 2012 7:19 AM (in response to ahmetsaid) nc is undefined in your code when that line 30 executes because it executes before application1_creationCompleteHandler() executes.fix that.import flash.net.NetStream; import mx.events.FlexEvent; private const CirrusAddress:String = "rtmfp://p2p.rtmfp.net/"; private const DeveloperKey:String = "mydevkey"; private var nc:NetConnection; private var myPeerID:String; private var recvStream:NetStream; private var myName:NetStream; protected function application1_creationCompleteHandler(event:FlexEvent):void {nc = new NetConnection();nc.addEventListener(NetStatusEvent.NET_STATUS,ncStatus);nc.connect("rtmfp://p2p.rtmfp.net/mydevkey/");nsF(); } protected
of the Adobe AIR Launchpad application (making it multi-lingual) and thought I would write up some notes for those facing this task. Flex 4 makes the localization task much easier. To read more about framework localization in particular (such as modifying the defaults used in the Alert dialog or Date controls etc), skip to this part of the post. The quick summary of steps is shown below, followed by more detail on each: 1) Update project compiler options 2) Create a locale folder 3) Create language subfolders 4) Create .properties files 5) Update your code with the metadata tag to reference the resource bundle 6) Update your code to select the locale to be used (or dynamically choose at runtime) 7) Update your code to substitute any text displayed in the application with the key from the properties file 1) Update Compiler Options - right click on your project and select Properties, then Compiler Options and on the Additional compiler options list the different languages to be supported in a comma-delimited fashion such as: -locale=en_US,ja_JP,fr_FR -source-path=locale/{locale} This will compile the resource bundles into the application. The other option is to load them at runtime. See this article for more details on how to do that. 2) Create locale folder - create a folder called ‘locale' under the project root such as shown in the screenshot below… *** NOTE: do not create it in the /src folder. If you do happen to create it there, you will have to add an additional compiler option -allow-source-path-overlap or you will get a warning. 3) Create subfolders for each language you are going to support using the language code and country format, such as en_US (English spoken in the United States), fr_FR (French in France) or pt_BR (Portuguese spoken in Brazil versus pt_PT - Portuguese spoken in Portugal) etc. See above screenshot for others… 4) Create properties files (to be used for resource bundles) - don't be afraid! Even though the name sounds kinda scary :), a resource bundle is simply an ActionScript class compiled from a text file with a .properties extension that maps key=value pairs of Strings. The text file should be in UTF-8 format so it can contain special characters. If you use Flash Builder it should detect the content and set this automatically so you shouldn't need to do anything extra. You can check to make sure though by right-clicking on the file and viewing the properties, such as: If you're a Java person, this should seem familiar. The name of the file minus the properties extension becomes the bundle. For instance, the LocalizedStrings.properties file would compile to a b