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
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Community Library Released for client side Dialog package (plus more)

hey guys,

 

i just did some tests and got the alpha change to work on a Label object. bascially in order for you to get it to work you have to wrap your label object into a sprite and then set the sprite's blendMode property to BlendMode.LAYER. after that change the alpha on the sprite and it should work just as you think it should. here is the sample code:

 

 

package
{
	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()
		{
			super();
			
			// 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";
			myLabel.setSize(150,52);
			
			myLabelContainer.addChild(myLabel);
			
			myLabelContainer.x = 10;
			myLabelContainer.y = 10;
			
			addChild(myLabelContainer);
			
			myBtn = new LabelButton();
			myBtn.label = "Do Animation";
			myBtn.setSize(150,52);
			myBtn.setPosition(300, 10);
			
			addChild(myBtn);
			
			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});
		}
	}
}

 

I've tested this on both the Desktop and the Simulator and it works both times. There is no bug in the Label QNX API. from what i've read, dynamic type textfields do not change alpha's unless it uses an embedded font (much like rotating it doesnt work unless you embed). my guess would that the QNX Label API is using a dynamic TextField object at some point. but the work around is to apply the effect on the sprite wrapping the label. hope that clears a few things up. good luck guys!

 

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
Please use plain text.
New Developer
jbeach42
Posts: 63
Registered: ‎10-27-2010
My Device: 9900 and PlayBook
My Carrier: Rogers

Re: Community Library Released for client side Dialog package (plus more)

Thanks!  Setting the blendMode on the parent sprite to BlendMode.LAYER did the trick!

-----------------------------------------------------------------------------
Apps:Beats Brainwave Entrainment - Awesome Timer - StarSlide - Save Santa
@jamiebeach
Please use plain text.
Developer
UberschallSamsara
Posts: 1,026
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Community Library Released for client side Dialog package (plus more)

@jtegen - Just curious why did you GPL this code?   (My understanding is anyone who compiles GPL'ed code into their app will have to distribute their full app source code to anyone, on demand.)

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Community Library Released for client side Dialog package (plus more)

Alternative suggestions?  I'm flexible.  If you make mods to the library that might be helpful to others, I would appreciate you sending those to me for review and inclusion.

Please use plain text.
Developer
UberschallSamsara
Posts: 1,026
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Community Library Released for client side Dialog package (plus more)

[ Edited ]

First I'm totally with you on contributing mods back to the library itself and would be happy to do so.

 

Second, I'm not an expert on open source licenses - I'm just trying to come up to speed on them and stay compliant with the rules on developer accounts.

 

Third, here's my high level understanding (which definitely has holes in it), from what I've read so far:

 

If you use GPL code in your software (create a derivative work) then anyone can demand you give them the source code for your app, and people sometimes do:  

 

http://en.wikipedia.org/wiki/NSLU2

 

"Linksys was required to release their source code as per the terms of the GNU General Public License."

 

This is probably undesirable for a lot of PlayBook developers wanting to release paid apps on the platform.

 

There is the Lesser GPL, which apparently has some abiguity about whether or not static linking (compiling LGPL open source into your app) is allowed. The intent of the LGPL seems to be to do what you intend (require libary modifications to be contributed back, without requiring release of the full source code of derivative works) but with the static linking confusion this feels impractical.  

 

http://en.wikipedia.org/wiki/LGPL

 

Then there are the so called more permissive licencses: MIT, BSD, Apache, among others that I think allow static linking, don't force application developers to release source code for their apps just because they are using open source, and allow modified code to be distributed in derivative works, including commercial works without *requiring* the modifications to be contributed back.  Like I said I still have lots of reading to do (and it's not my idea of fun).

 

My take on this is that the GPL & LGPL while well intentioned have major downsides that cause folks trying to write a commercial app to stay the heck away from them.  The intended spirit seems to be share and share alike but the practical effect may be that nobody can really make money selling GPL'ed apps because the next guy and the next guy and the next guy can demand the source code, add a few tweaks, and attempt to monetize w/their tweaks.  If they sell well then others can demand the source and sell it too, and if not then they don't make money.  In other words a race to the bottom at least for paid software (open source software support is a different business).

 

My sense is lots of folks say to heck w/GPL/LGPL and go MIT/BSD/Apache, and many of us can be grownups and freely contribute back to open source, without being coerced into it by the GPL's  mandate for "freedom" being crammed down our throats.  

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Community Library Released for client side Dialog package (plus more)

wow that is a lot of stuff. i just wish there was a "do whatever you want, just please submit any updates you make to the library itself." license lol everything is so complicated.

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
Please use plain text.
Developer
UberschallSamsara
Posts: 1,026
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Community Library Released for client side Dialog package (plus more)


JRab wrote:

wow that is a lot of stuff. i just wish there was a "do whatever you want, just please submit any updates you make to the library itself." license lol everything is so complicated.



+1!!!


Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Community Library Released for client side Dialog package (plus more)

Well, maybe I'll just change it to the JRT license (my initials).  "Use it as you like, but please send useful updates back to me for review and inclusion to the library so that others will benefit" license.

 

No, really.  If there is a valid public license that meets the nature of the above statement, please let me know; otherwise, I will just paraphrase my own.

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Community Library Released for client side Dialog package (plus more)

and john dont forget this line, "Please do no sue me for any problems or damages." prolly a little important :smileyhappy:

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
Please use plain text.
Developer
UberschallSamsara
Posts: 1,026
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Community Library Released for client side Dialog package (plus more)

[ Edited ]

Yeah I think they all have a disclaimer about being "AS-IS without warranty of fitness for purpose" etc.

 

I'm looking to learn the details of the major licenses, but not today, and not all at one sitting.  Got code to write.

 

It's probably worth considering for anyone releasing open source code to review the most widely used licenses and pick the one that most closely matches their intentions, vs. rolling their own.

 

Especially if they'd like to see their code used widely (and thus more likely to be contributed back to), potential users are more likely to find and pick up and use something that has a well known license that they already are familiar with. 

 

P.S.  @jtegen - No rush to do it today; I think you made your (perfectly reasonable) intentions clear, and it can be handled over whatever time frame you want to spend reading up on the different licenses.  Main reason I asked you about GPL'ing your code was that I suspected the implications of GPL weren't really your intention ... 

Please use plain text.