Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 23
Registered: ‎12-17-2010
My Device: Not Specified
My Carrier: Software Engineer
Accepted Solution

How to hide text input border?

Hi

 

I want to hide the border of  my TextInput component.

I tried the following from actionscript examples:

 

textBoxInstanceName.border = true;
textBoxInstanceName.borderColor = 0xFF0000;

 

AND

 

textBoxInstanceName.setStyle("bordercolor",0xffffff);

 

But this is not working for me. Is it possible to do this?

Please help me, if anyone have any idea.

 

Thanks

 

Aswathy

 

Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: How to hide text input border?

hey,

 

the only way to change the way a TextInput object looks in your application is changing its "skin". to do this you must create your own skin class that extends the UISkin class. Here is a sample you can use a guide pulled from the skin page from the ASDocs:

 

 

 package
  {
	import qnx.ui.skins.SkinAssets;
	import qnx.ui.skins.UISkin;
	import qnx.ui.skins.SkinStates;


	import flash.display.Sprite;

	
	public class CustomButtonSkin extends UISkin 
	{
		/**@private**/
		protected var upSkin:Sprite;
		/**@private**/
		protected var selectedSkin:Sprite;
		/**@private**/
		protected var disabledSkin:Sprite;
	    	 /**@private**/
		protected var downSkin:Sprite;


		/**
		 *Create a custom button skin
		 */
		public function CustomButtonSkin() 
		{
			super( );
		}

	  
		override protected function initializeStates():void 
		{

		upSkin = new Sprite();
		upSkin.graphics.beginFill(0xFF6600);
		upSkin.graphics.drawRect(0,0,200,200);
		upSkin.graphics.endFill();

		downSkin = new Sprite();
		downSkin.graphics.beginFill(0x333333);
		downSkin.graphics.drawRect(0,0,200,200);
		downSkin.graphics.endFill();

	    	disabledSkin = new Sprite();
		disabledSkin.graphics.beginFill(0xCC0000);
		disabledSkin.graphics.drawRect(0,0,200,200);
		disabledSkin.graphics.endFill();

	    	selectedSkin = new Sprite();
		selectedSkin.graphics.beginFill(0x000000);
		selectedSkin.graphics.drawRect(0,0,200,200);
		selectedSkin.graphics.endFill();


		setSkinState(SkinStates.UP, upSkin );
		setSkinState(SkinStates.SELECTED,selectedSkin );
		setSkinState( SkinStates.DISABLED, disabledSkin );
		setSkinState( SkinStates.DOWN, downSkin );
		showSkin( upSkin );

		}
	}
  }

 

 

The above code changes a way a Button object looks but you can easily manipulate it to work with a TextInput object. After setting up your custom skin class you can apply it to your TextInput object using the setSkin() method in your application on the object itself. It's a little tricky but once you've gone through it, it gets a little easier.

 

Here is a link with more detail about skinning:

 

http://www.blackberry.com/developers/docs/airapi/1.0.0/qnx/ui/skins/package-detail.html

 

There are also a few posts around the forum that have good info. Here is one in particular that I refer back to:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/How-do-I-skin-a-TextInput-compone...

 

hope that helps. good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Contributor
Posts: 23
Registered: ‎12-17-2010
My Device: Not Specified
My Carrier: Software Engineer

Re: How to hide text input border?

Thanks for your help.

Skinning, i hav tried for ToggleSwitch component.

For redusing the size of toggleswitch.

 

But Failed!!!Smiley Sad

 

 

Then I thought it is not possible for playbook.

 

But I think I can work out using your example code.

I will try to implement this for TextInput now now.

 

 

Highlighted
Contributor
Posts: 23
Registered: ‎12-17-2010
My Device: Not Specified
My Carrier: Software Engineer

Re: How to hide text input border?

THanks a lot... Text Input Skin works for me.

 

I really likeSmiley Happy Skinning..it can do a lot for our gui..