Hidden objects

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Damlimey
Posts: 31
Joined: Sun May 31, 2009 10:56 am

Hidden objects

Post by Damlimey » Mon Jul 13, 2009 6:03 pm

Hi everyone,

Thanks for all the valuable help that you guys are providing me with, I'm getting my head around all this pretty well but once again, I need a nudge in the right direction.

I want to hide a couple of objects from my stack, call them with a menu item, make adjustments with the objects on this 'control stack/card' and then hide the objects again. For example, I have an audio player, I want to call a volume control slider with a menu option, change the volume and then hide the slider.

I have absolutely no idea how to approach this but if you guys have any tips...

Thanks all,

D
So, it's a big Salami... Just take it one slice at a time.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Mon Jul 13, 2009 6:37 pm

Hi D,

the magic word (property) is "visible"!

You could with the menu
...
set the visible of sb XYZ to true"
...
and in the script of the scrollbar:

Code: Select all

on mouseup
 set the visible of me to false
end mouseup
Since the "scrolling" of a scrollbar will take place when the mouse is
down, this might work, or at least give you a clue where to start :)

Best

Klaus

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Mon Jul 13, 2009 6:38 pm

Hi Damlimey, for hiding and showing any object you need... hide and show!

Code: Select all

show player "XYZ"
and

Code: Select all

hide player "XYZ"
Or you could use:

Code: Select all

set the visible of player "XYZ" to true
and

Code: Select all

set the visible of player "XYZ" to false
You can show hidden objects at any time by checking Show Invisible Objects in the Rev main menu bar.

:)

Edit: Klaus beat me to it!!

Damlimey
Posts: 31
Joined: Sun May 31, 2009 10:56 am

That's great!

Post by Damlimey » Tue Jul 14, 2009 8:01 am

Thanks for that, but say I wanted to put a couple of objects like a volume slider, a tick box for loop on/off and some other switches on a separate hidden thing. Would that thing be a stack, a card or a group, and how would I call that?

Thanks in advance...

D
So, it's a big Salami... Just take it one slice at a time.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: That's great!

Post by Klaus » Tue Jul 14, 2009 10:01 am

Hi D,
Damlimey wrote:Thanks for that, but say I wanted to put a couple of objects like a volume slider, a tick box for loop on/off and some other switches on a separate hidden thing. Would that thing be a stack, a card or a group...
depends on how much "room" is left in the stack that you want to control.
If you have a "free" corner in your stack then a group might be useful.
If not, I would use a palette window.
Damlimey wrote:...and how would I call that?
Harold? :D :D :D


Best

Klaus

Damlimey
Posts: 31
Joined: Sun May 31, 2009 10:56 am

Okay, so I made Harold a sub-stack

Post by Damlimey » Tue Jul 14, 2009 10:16 am

When I call 'Harold' with a menu command, up it pops and on it I place my slider to control the gain of the player on the main stack. Thing is, now the slider on Harold doesn't see the player on the main-stack. I also gave Harold a button to close it

Code: Select all

set the visible of stack "Audio stack" to false


so I can call Harold from the main-stack menu and I can close Harold with a local button but I can't get the objects on Harold to control objects on the main-stack.

(Plus, my dictionary seems to have disappeared and that's driving me close to madness!)

Whad'ya think?

Thanks, D
So, it's a big Salami... Just take it one slice at a time.

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Tue Jul 14, 2009 10:25 am

Hi D

Groups are explained very well (as well as lots of other stuff) in the Revolution User Guide pdf, for your info.

so I can call Harold from the main-stack menu and I can close Harold with a local button but I can't get the objects on Harold to control objects on the main-stack.
An example might be (called from your substack you've called Harold :wink: :

Code: Select all

put field "ABC" into field "XYZ" on card 1 of stack "NameofStack"
Hope that's useful for you.

:)

Damlimey
Posts: 31
Joined: Sun May 31, 2009 10:56 am

I hope you realise...

Post by Damlimey » Tue Jul 14, 2009 11:15 am

Every time you send me a hint and a line of code like that, you give me the boost I need to carry on and the possibilities open up for me and my project!

Thank you for that, hopefully, this will keep me quiet for a while!

All the best,

D
So, it's a big Salami... Just take it one slice at a time.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Tue Jul 14, 2009 11:21 am

Now Gyroscope beat me to it :D

Anyway, I would NOT recommend to hide your control palette!
Just close it!

Imagine this:
1. you hide "Harold"
2. you save your stack (including its substack "Harold" without showing it again before saving!)
3. you open that stack the next day
4. you call "Harold"
5. nothing happens, at least nothing is visible since the "visible" prop of "Harold" also got saved!
6. you lose your mind
7. you don't like that
:D


Best

Klaus

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Post by shadowslash » Wed Jul 15, 2009 4:03 pm

Klaus wrote:6. you lose your mind
7. you don't like that
Loll Image
Parañaque, Philippines
Image
Image

Post Reply