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

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind
Accepted Solution

CustomControl background change

Hello everyone, I made a customcontrol in QML that has a background image and text overtop. What I want to do is fade out the background and fade in a new image. I know I can use a fadeTransition animation to fade it in our out but I am unsure how to just access the image of the customcontrol rather than animate itself in its entirety. I know properties can be defined in the customcontrol.qml file, but is it possible to just animate a part of the control? My alternative is to make two different controls with each different image and fade  one out and the other in. 

 

so far I create a instance of the customcontrol like this:

 MusicButton {
      id: music
      opacity:0
          animations: [
              FadeTransition {
                  id:fade
                   duration:1000
                   easingCurve: StockCurve.CubicOut
                   fromOpacity: 0
                   toOpacity: 1
               }
           ]
                layoutProperties: AbsoluteLayoutProperties {
                                    positionX: 145
                                    positionY: 325
                                }
                                onTouch: {
                                    if (event.isDown)
                                        fadeIn(); 
                                }
                                    
            }

 

 

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: CustomControl background change

I have not played with animations much, but the documentation suggests that the property target should do the trick:

https://developer.blackberry.com/cascades/reference/bb__cascades__abstractanimation.html#target

 

Stuart

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: CustomControl background change

Did this do the trick?  (If so, please accept the solution)

Or are you still stuck?

If you solved it some other way, please follow up with the solution.

 

Stuart

Developer
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind

Re: CustomControl background change

My apologies, I must have missed the reply, I am out currently but will test it and get back asap
Highlighted
Developer
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind

Re: CustomControl background change

Your solution was appropriate, thank you for showing it and reminding me of it Smiley Happy