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

Posts: 10
Registered: ‎01-19-2011
My Device: Playbook simulator
Accepted Solution

Tweening and Embedding Fonts

I am using Tweenlite to tween the alpha of Textfields.


It tweens properly being run on the desktop, but when it is run on the simulator it no longer adjusts the alpha.


I tried: embedFonts = false; and embedFonts = true;


            buttonFormat.align = "left";
            buttonFormat.bold = true;
            buttonFormat.color = 0xFFFFFF;
            buttonFormat.font = "BBAlpha Sans, Arial";
            buttonFormat.letterSpacing = 0;
            buttonFormat.size = 14;
            buttonText.text = "test";
            buttonText.autoSize = "center";
            buttonText.embedFonts = false;
            buttonText.gridFitType = "PIXEL";
            buttonText.selectable = false;
            buttonText.antiAliasType = "ADVANCED";

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

Re: Tweening and Embedding Fonts

hey Reveller,


i made a post a little while back showing a way to do tweening of the alpha of a label object without the need to embed. the basic jist is you have to put the label inside of another sprite that has its blendmode to layer. then tweent he sprite. it will tween the label inside of it along with it. here is the code:





	import caurina.transitions.Tweener;
	import flash.display.BlendMode;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.MouseEvent;
	import qnx.ui.buttons.LabelButton;
	import qnx.ui.text.Label;
	[SWF(width="1024", height="600", backgroundColor="#CCCCCC", frameRate="30")]
	public class TweenTest extends Sprite
		private var myLabel:Label;
		private var myLabelContainer:Sprite;
		private var myBtn:LabelButton;
		public function TweenTest()
			// support autoOrients
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			myLabelContainer = new Sprite();
			myLabelContainer.blendMode = BlendMode.LAYER;
			myLabel = new Label();
			myLabel.text = "Sample Text";
			myLabelContainer.x = 10;
			myLabelContainer.y = 10;
			myBtn = new LabelButton();
			myBtn.label = "Do Animation";
			myBtn.setPosition(300, 10);
			myBtn.addEventListener(MouseEvent.CLICK, startFadeOut);
		private function startFadeOut(e:MouseEvent):void
			Tweener.addTween(myLabelContainer, {alpha: 0, time: .5, onComplete: startFadeIn});
		private function startFadeIn():void
			Tweener.addTween(myLabelContainer, {alpha: 1, time: .5});



Here is the post with a little more detail:




hope that helps you out. 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
Posts: 10
Registered: ‎01-19-2011
My Device: Playbook simulator

Re: Tweening and Embedding Fonts

Thanks I got your example and embedding fonts working also.


Smiley Happy

Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Tweening and Embedding Fonts

Changing the alpha of labels/text is a known issue with BB and is in their tracking database.  No word in what version this will be corrected in.