Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 9:41 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: On/off button
PostPosted: December 9th, 2009, 11:13 am 
Offline

Joined: December 9th, 2009, 10:51 am
Posts: 3
How can I create an off/on button?
Or have I missed such a thing ready made somewhere in the galleries?
I have Opus Creator 6 and run WinXP.
- yes I have read the user guide and searched this forum....but I haven´t found anything.
What it should do:
Left click on it (button A) should show a button B, next left click on A should hide button B, click again and button B reappears etc. Just like switching on and off music.
Please anybody let me know the principal procedure.
The on/off button: this is really very important for my publication.


For this message Lori has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: December 9th, 2009, 12:09 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Lori,

I know that you'd rather not script but it's really easy for this. You simply

1. create two buttons - buttonA and buttonB
2. on buttonA add a 'left click trigger'
3. on this trigger add a script action
4. in the script action add the following line.

buttonB.IsShowing() ? buttonB.Hide() : buttonB.Show()

This will hide /show buttonB when you toggle buttonA.

If you want to understand the script it does the following:

1. buttonB.IsShowing() - checks whether buttonB is showing and return true if it is.

2. ? buttonB.Hide() -the question mark bit is what happens if true - in this case hide the buttonB because it's currently showing.

3. : buttonB.Show() - the colon bit is what happens if false - in this case show buttonB because it's currently hiding.


Hope this helps,

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: December 9th, 2009, 12:26 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Opus and related products give you several ways to accomplish a thing.

Here's another idea for your Button A and B.
Assuming you want the result to be: press something 'down', it stays 'down' and music is 'On'. Press same button again, it returns to 'up' and music is turned 'Off'.

'Yes' you wanted to have the button be 'different' or look 'different' too. You can achieve this somewhat... using a single button. In Creator, pay close attention to the button Object's properties (that is, bring up the Properties dialog box and make appropriate settings).
1-- set the Button Type or its options... to be "Push Button" (I think it's called).
2-- Notice that there are Button 'States'. Default, for example, can have its own color and its own Text Label.
Then Click on the Button-Down state, and change the colour and label for that state.
Note: Be sure to click again back on the Default ICON --- so that Creator uses that as the initially shown state. Important to remember.

So all that is left is to assign your Actions (according to the triggers of mouse-click and/or the conditional for its state of 'down' or 'up').

I think the help files or manual will reinforce more clearly how this is done.

Cheers.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: December 9th, 2009, 1:17 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Unfortunately, button states relate only to appearance not actions. You'd still need to script on / off bit.

However, if you prefer to cheat - it's not really, then create one button for on and one button for off and simply use the hide show actions for the on / off buttons which are placed on top of each other.

As one is hidden the other appears and vice-versa. Each button would control it's own aspect of buttonB, but it would seems that it was a single button turning it on or off.

A little Opus Magic as compared to the Opus Science in the first post :-)

Regards,

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: One Button
PostPosted: December 9th, 2009, 3:32 pm 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
I was going to offer the one Button approach Lar suggested. You can use a couple of minor changes to solve the Action situation Mack pointed out.

From the Button Propterties Menu, tick the "Checkbox (Push On - Push Off)", THEN tick "Link to Variable." I created a NEW Variable (Text) called "On_Off" which should appear in the box under "Link..."

Click on the ACTIONS tab for this Button. From the Programming menu add these Select & Case Actions: (See graphic)

Select (On_Off)
- true
-- Hide Some text
- false
-- Show Some text

For test purposes, I created a Text Object called "Some Text" with some text in it. Any Action will work.

So when you Preview this, when you first click the Button, my Text Object disappears and the Button has a Red surface with "Off" showing. When you click it again, the white surface color returns and the Text becomes "On" while the Text Object reappears.


Attachments:
Action Sample.jpg
Action Sample.jpg [ 59.06 KiB | Viewed 9690 times ]

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


For this message demofred has been thanked by : mackavi
Top
 Profile Visit website  
 
 Post subject:
PostPosted: December 9th, 2009, 6:20 pm 
Offline

Joined: December 9th, 2009, 10:51 am
Posts: 3
Hello and THANK YOU all for your help!
I tried mackavi´s way first and it worls! I was lucky because I didn´t even know how to select a script action (which? variable? programming? what?) After a few minutes of guessing I came up with a combination that let me paste in mackavi´s lines - and it works!!!!! see attachment, - for all the other sufferers who are in desperate need of a switch button like me........ Surely I will try out Lar_123´s and demofred´s suggestions as well! Also I will meditate upon mackavi´s explanations of what the terms mean...who knows, one day I might get scripting....
Thank you sll again!


Attachments:
File comment: Where I put the lines...
2009-12-09.png
2009-12-09.png [ 11.63 KiB | Viewed 9727 times ]


For this message Lori has been thanked by : mackavi
Top
 Profile  
 
 Post subject:
PostPosted: December 9th, 2009, 11:29 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Lori,

I don't have Creator installed but if you have access to a script action it would be better to use that. It would be on the programming tab. If you don't then that is damn clever work around :-)

Kudos to Fred, the action based method is very straightforward for non scripting version of Opus.

Mack


Attachments:
File comment: Script Action
sshot-1.png
sshot-1.png [ 20.36 KiB | Viewed 9687 times ]

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057
Top
 Profile Visit website  
 
 Post subject:
PostPosted: December 10th, 2009, 1:45 pm 
Offline

Joined: December 9th, 2009, 10:51 am
Posts: 3
thanks mackavi - no I don´t have a script action in opus creator ..... is it worth upgrading to pro?????? - only opus pro has that and I am afraid it would take me years to take advantage of such an investment.
The screenshot I posted yesterday with your lines in.....it works great that way and I would say: never change a winning team....I have been working today with it for some hours and love it.
The other methods I will try as well.....
Thanks anyway!


For this message Lori has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: December 10th, 2009, 3:12 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Lori wrote:
I am afraid it would take me years to take advantage of such an investment.


Morning Lori,

I'd imagine that if you're apt enough to work out how to add scripting without a scripting action then you'd probably find it a rather effective way of developing publications.

That said, Pro is an expensive upgrade that mostly offers advanced features such as SCORM and ODBC as well as an ECMA based scripting language. If you're developing publications with lots of actions then script can make it much easy, quicker and thus cost effective - and IMHO fun!

BTW, it's best to add a signature to your profile (link at top).

Regards,

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group