Join Our 3 MILLION+ Members Today! Register Here | Login
Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > Theme Developers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
    Thread Author   #1  
Old 08-19-2010, 07:08 PM
CrackBerry User
Device(s): 8520
Carrier: AT&T
 
Location: Oxnard, CA
Join Date: Jul 2010
Posts: 14
Likes Received: 0
Thanked 0 Times in 0 Posts
Default object visibility on button activate

Can someone please enlighten me as to the syntax for controlling a layer's visibility by clicking on a button? I can even get away from controlling an entire layer and just controlling an object, but I'd really like help with each (if they're different...I'd guess the syntax is the same you just use the object id instead of the layer id).
I can manipulate the position of a layer on focus, but I have never worked with layer visibility nor have I used the .activate function. So, some insight would be greatly appreciated. I've been trying to find information on it for the past 3 or 4 days and I'm coming up dry. And, maybe I've found what I need, but just don't understand the terminology of the .svg language??? Always a possibility!

Thanks for any help,
__________________
Gary
Reply With Quote Tip this Post
  #2  
Old 08-19-2010, 10:07 PM
CrackBerry Genius
Device(s): 9550 (Storm2)
Carrier: Verizon
 
Join Date: Feb 2009
Posts: 1,500
Likes Received: 0
Thanked 4 Times in 2 Posts
Default

If I understand what you are looking for, try this out. Create a button called "Show" and another called "Hide", then use this in your SVG:

To Hide:
<set xlink:href="#Layer1" attributeName="visibility" to="hidden" begin="hide.focusin"/>

To Display:
<set xlink:href="#Layer1" attributeName="visibility" to="visible" begin="show.focusin"/>

Hope it helps.
__________________
- RIP Storm, Now Rockin' with DroidX and haven't looked back - [My Themes]
Reply With Quote Tip this Post
    Thread Author   #3  
Old 08-19-2010, 11:11 PM
CrackBerry User
Device(s): 8520
Carrier: AT&T
 
Location: Oxnard, CA
Join Date: Jul 2010
Posts: 14
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

Bob,
I'll give that a try. Will that show and hide on focus or when the button is clicked?

Thanks for the help,

<<EDIT>>
It did work, but it made the button visible when I focused in on the button. What I'm trying to do is have the button appear on focusin (which this does), but how can I make that button make a layer visible once I click on the button?

Thanks again for the help...I'm half way to were I'm trying to get :-) I'll play around with it and see if I can use the same syntax to get a layer visible!

Much appreciated,
__________________
Gary

Last edited by 24kGEM; 08-19-2010 at 11:20 PM.
Reply With Quote Tip this Post
    Thread Author   #4  
Old 08-19-2010, 11:46 PM
CrackBerry User
Device(s): 8520
Carrier: AT&T
 
Location: Oxnard, CA
Join Date: Jul 2010
Posts: 14
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

I believe I got it to work...actually, I know I got it to work, I just have to clean it up a bit and it will be perfect!
Thanks again Bob for your help! I changed the .focusin to .activate and it worked like a charm. It now hides the layer when I click the button instead of just focusing on the button.

I guess I should have posted this a few days ago :-) Would have save me a lot of time.
__________________
Gary
Reply With Quote Tip this Post
  #5  
Old 08-20-2010, 09:02 AM
CrackBerry Genius
Device(s): 9550 (Storm2)
Carrier: Verizon
 
Join Date: Feb 2009
Posts: 1,500
Likes Received: 0
Thanked 4 Times in 2 Posts
Default

Glad I was able to help you get what you wanted accomplished.
__________________
- RIP Storm, Now Rockin' with DroidX and haven't looked back - [My Themes]
Reply With Quote Tip this Post
    Thread Author   #6  
Old 08-20-2010, 04:13 PM
CrackBerry User
Device(s): 8520
Carrier: AT&T
 
Location: Oxnard, CA
Join Date: Jul 2010
Posts: 14
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

Hey Bob (or anybody),
I can now make a layer visible by clicking a button...but what's the best way to make the layer hidden again?
Can I do a "layer".focusout, or will that screw things up when I click the button to make that layer visible, but it doesn't have focus yet (or does it have focus and the button no longer has focus?)...so, I'm thinking that might not work because then it will fight with the button click and the .focusout.
Can I make another .activate for the button or will that cause issues as well?

Would love to hear from anybody on the best way to change the layer visibility a second time,
__________________
Gary
Reply With Quote Tip this Post
    Thread Author   #7  
Old 08-20-2010, 11:15 PM
CrackBerry User
Device(s): 8520
Carrier: AT&T
 
Location: Oxnard, CA
Join Date: Jul 2010
Posts: 14
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

I've got it in working order...but I had to use .focusin and .focusout instead of .activate so that I could get the layers to move like I wanted. I would have preferred the layers to come in from the side of the screen when I click the button, but instead I just move up and the layer moves in from the right.
I think it would make more sense to click the button, but moving up works for now.
I'd still like to know how to use the button click to make the layer move on screen and off. If you can help, please let me know!

Thanks all,
__________________
Gary
Reply With Quote Tip this Post
  #8  
Old 08-21-2010, 09:44 AM
CrackBerry Genius
Device(s): 9550 (Storm2)
Carrier: Verizon
 
Join Date: Feb 2009
Posts: 1,500
Likes Received: 0
Thanked 4 Times in 2 Posts
Default

Sounds like you are looking for info on how to create a hidden dock - check out BBThemeLab, a great video available there on how to do that.
__________________
- RIP Storm, Now Rockin' with DroidX and haven't looked back - [My Themes]
Reply With Quote Tip this Post
    Thread Author   #9  
Old 08-23-2010, 12:16 PM
CrackBerry User
Device(s): 8520
Carrier: AT&T
 
Location: Oxnard, CA
Join Date: Jul 2010
Posts: 14
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

Bob,
Ya...it's like a hidden dock. I've got it working where I click on a button at the bottom of the screen and the layer moves into view. I can then move up to interact with that layer, and then when I move down, the button that activated the layer appears and gets focus again and the layer moves back off screen.
What I was really trying to do, with a single button, is to move the layer on to the screen and then click the button again to move it off the screen. Then scroll to the next button (like tabs across the bottom of the screen) and click it to view it's layer and then click again to hide.
I didn't want to have to scroll up to the layer and back down to get the layer to move off screen...but I'm thinking that's the only way possible to do it...WAIT...I THINK I MAY HAVE JUST FIGURED IT OUT :-)
When I click a button, I can have it move the layer onto the screen as well as having a new button take the place of the button I just clicked. Then I can click that button which will move the layer off the screen, as well as make the original button take the place of the second button...so I'm right back where I was.
Do you follow what I'm trying to do? And, is this idea the best way to make it work?

Thanks again,
__________________
Gary
Reply With Quote Tip this Post
  #10  
Old 08-31-2010, 09:10 PM
CrackBerry Abuser
Device(s): 9000 & 9700 (Bold)
Carrier: Cable & Wireless
 
Join Date: Nov 2009
Posts: 104
Likes Received: 0
Thanked 3 Times in 3 Posts
Default

try this:

1. Make a button and name it HIDE.

2. Duplicate the button, rename it SHOW and let it in the same position, just over/under the HIDE button.

3. now the code:

<set xlink:href="#SHOW" attributeName="display" to="none" begin="0"/>

<set xlink:href="#Layer_1" attributeName="display" to="none" begin="HIDE.activate"/>

<set xlink:href="#HIDE" attributeName="display" to="none" begin="HIDE.activate"/>

<set xlink:href="#SHOW" attributeName="display" to="inline" begin="HIDE.activate"/>

set xlink:href="#Layer_1" attributeName="display" to="inline" begin="SHOW.activate"/>

<set xlink:href="#SHOW" attributeName="display" to="none" begin="SHOW.activate"/>

<set xlink:href="#HIDE" attributeName="display" to="inline" begin="SHOW.activate"/>


the layer is controlled by two different buttons but make the ilusion that there is only one button.

You must use display and not visibility to prevent the hidden button from been focused. For the layer part you could use also transform to make it slide.

Please verify the code syntax and any mistyping, hope you get the concept and figure it out.
Reply With Quote Tip this Post
Reply
BlackBerry Forums at CrackBerry.com > > BlackBerry Professionals > Theme Developers   object visibility on button activate

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes