Home » ActionScript 3.0, Flex

mx_internal in Flex

31 March 2010 No Comment
Share on Facebook

I came across a nice topic in Flex today its “mx_internal”.
mx_internal is a access modifier in Flex source code, since Flex is an open source you can look into the code. Adobe has encapsulated some variables in Flex Framework that will change in future release of Flex, So its good to avoid using mx_internal in projects.

mx_internal is a way to access variables that are hidden but available to use for developers.

we can use the variables in the code before that we need to import.

import mx.core.mx_internal;

< ?xml version="1.0" encoding="utf-8"?>

	
	
		< ![CDATA[
			import mx.controls.TextInput;
			import mx.core.mx_internal;
				
			protected function initButton():void
			{
				var tf:TextField = bt.mx_internal::getTextField()
				tf.visible = false;
			}
		]]>
	
	

Here we are accesing the TextField from button and making it invisible. So this is just an easy way to access all the variables of a component.

Note:
Adobe uses the mx_internal namespace to mark things that may change in future versions of the framework , so you have to use it at your own risk.

GET THE UPDATES VIA EMAIL

We don't share your email anywhere, grab our rss via feedburner