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
Deevych
Posts: 93
Registered: ‎02-05-2011
My Device: Not Specified
Accepted Solution

No effect using backgroundColor

Hello,

 

I was trying to use the samples from the dev guides, but I see no effect from using the backgroundColor option in this code:

[SWF(height="600", width="1024", frameRate="30", backgroundColor="#BBBBBB")]

In my case the color is always White, no matter what values are set in there.

 

The only way I found for now is to draw another rect or picture with a color I need, but what about default OS app skinning in that case?

 

Any solutions for this?

Or is it an "as is" for this version of the SDK?

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

Re: No effect using backgroundColor

Hey,

That line works for me. Where is the _exact_ location you are placing that line in your code? The line before it and after it wud be great. Thanks!
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
Developer
Deevych
Posts: 93
Registered: ‎02-05-2011
My Device: Not Specified

Re: No effect using backgroundColor

[ Edited ]

Man, you're genius! And I'm a dumb... :smileyvery-happy:

 

I had it before the constructor, while I should have it before the class declaration.

Shame on me...

 

P.S. any way to remove the topic? Or leave it as a tip for others like me?

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

Re: No effect using backgroundColor

Hey,

Lol don't sweat it. We make those kinds of mistakes all the time! And the usual way of doing things here is you ask a question, get it solved, mark the solution and keep the topic here for others to find if they run into the same problem. Don't be embarrassed. No reason to be. We're all human :smileywink:
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
Developer
Deevych
Posts: 93
Registered: ‎02-05-2011
My Device: Not Specified

Re: No effect using backgroundColor

You are absolutely right.

In any case, I really appreciate your help!

 

Developer
tags07
Posts: 386
Registered: ‎12-12-2010
My Device: BB Style

Re: No effect using backgroundColor

On a related note, I have been seeing similar issues with the new SDK(0.9.3). Let me explain...

 

Here's a snippet from my AS file:

 

===================================

 

   package
   {
        import flash.display.Sprite;
        import flash.display.Bitmap;
        import flash.events.Event;
        ...
        ...
import qnx.ui.core.Spacer;
import qnx.ui.text.Label;
[SWF(height="600", width="1024", frameRate="30", backgroundColor="#000000" )]
public class AppleCatch extends Sprite {  
...
...

 

====================================

Previously, I had a nice black background for my app. On the new simulator, that didn't take effect, instead had a transparent background. In my case I was using Container() class to subdivide the screen. After a little probing was able to resolve it by calling the opaqueBackground() method of the main Container...like this:

 

...

...

 

   private function createObjects():void 

   {

 

// create main container //

myMain = new Container();

myMain.margins = Vector.<Number>([5,5,5,5]);

myMain.flow = ContainerFlow.HORIZONTAL;

myMain.opaqueBackground = 0x000000;

//myMain.debugColor = 0xFFCC00;

addChild(myMain);

 

...

...

 

Still not clear why it changed in the new SDK and why the SWF macro doesnt work. Probably some silly mistake I did...will probe update my comments if I find anything else.

 

 

 

 

 

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

Re: No effect using backgroundColor

In blackberry-tablet.xml, do you have transparent set to true?

 

<qnx>
  <initialWindow>
    <systemChrome>none</systemChrome>
    <transparent>false</transparent>
  </initialWindow>
  ...
</qnx>

 

Developer
tags07
Posts: 386
Registered: ‎12-12-2010
My Device: BB Style

Re: No effect using backgroundColor

There you go...you are a genius, jtegen..

 

Indeed I have it set to true :smileyhappy:

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

Re: No effect using backgroundColor

@tags: thats why they pay him the big bucks :smileywink:

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
Developer
tags07
Posts: 386
Registered: ‎12-12-2010
My Device: BB Style

Re: No effect using backgroundColor

I must say you guys must be so passionate about BB to support this forum on weekends too..esp posting a reply before 9am on a Saturday...  :-p