Indigo Rose Software
  #1  
Old 02-27-2006
Roboblue's Avatar
Roboblue Roboblue is offline
Forum Member
 
Join Date: Dec 2003
Posts: 888
More Menu Bar Examples

After struggling for many hours with creating the Menu Bar at runtime, Thanks to Desmond and rhosk, I think I finally have a handle on it.

The examples below show three ways to create and change the Menu Bar at runtime.
Note that in all three examples, the Menu Bar is Not Shown (disabled) in the AMS design view. you will have to preview to see the results.

In all of the examples, there are four desired actions.
1. To toggle the on-top function on/off.
2. To toggle the background music function play/pause.
3. To enable/disable the sub menus for the above functions.
4. To pass what state the above functions from page to page.

All of the examples accomplish the desired actions, with different methods.
In all the examples, the necessary code is in the Project Global-On Start, The Page Preload, On Show, On Menu, and the Buttons' On click events.
The Lua script resides in Scripts folder.

The first example uses Lua script to create and control the actions of the Menu Bar and is called by a run.script action in the Page Preload. The layout of the Menu Bar and the menu selected actions all reside in the script. The script residesThere are functions built in the Global section to control the selected actions, and to change the Menu Bar as needed.

The second example uses the Lua script to create the basic menu, but puts the menu changes and actions on the Page On Menu event. This streamlines the Lua script, but loads up the On Menu event.

The third example removes the Lua script altogether. The Menu Bar is created on the Page Preload event, and the menu actions are on the Page On Menu event.

In these examples, only one Lua script is needed for the whole project as the Basic Menu Bar will stay the same. This is good if all your pages will have the same basic Menu Bar features.
However, if you have a lot of different actions for each page, you may be served well by using Lua script for the Menu Bar.
An example of this would be if you put out a demo version of your application, then you just send a "key" to unlock the application after the trial. Then you would want use two different scipts for each page. A demo script and a regged script. Just use a trap technique to determine if it has been regged, then an "if" statement to run.script the alternate reg script.
It would be up to the developer which method would be easier to maintain, or change project to project.
The non lua script method will not have an external script debugging process. But, if it works in the script, it'll work in the Page Preload, too.
Lots of pros and cons, so it's up to you to decide waht's best for a given situation.
This post will self destruct in 10..9..8..7.
Attached Files
File Type: apz first example.apz (214.1 KB, 1216 views)
File Type: apz second example.apz (214.1 KB, 936 views)
File Type: apz third example.apz (213.9 KB, 984 views)
Reply With Quote
  #2  
Old 02-27-2006
bobbie's Avatar
bobbie bobbie is offline
Forum Member
 
Join Date: Feb 2005
Location: Mn
Posts: 770
I tried all three of them and they are really cool ,, but the off does not work? the Pause does but not the off .
And if I leave one and say start the number three it will be playing the music from when I had number one on.
Reply With Quote
  #3  
Old 02-27-2006
Roboblue's Avatar
Roboblue Roboblue is offline
Forum Member
 
Join Date: Dec 2003
Posts: 888
bobbie
the on/off is to set the application for always on top. click the on and open another app/window.
"And if I leave one and say start the number three it will be playing the music from when I had number one on."
that's odd. I relly can't say what is causing that as the 3 examples don't interact at all.
I certainly can't replicate that.
Reply With Quote
  #4  
Old 02-27-2006
Roboblue's Avatar
Roboblue Roboblue is offline
Forum Member
 
Join Date: Dec 2003
Posts: 888
whoosh, I just reread my first post and see a lot of typing errors. I just switched from a full size multimedia keyboard to a small Zippy backlit one and I'm having a hard time with it. Being partly dyslexic doesn't help, either.
Reply With Quote
  #5  
Old 02-27-2006
bobbie's Avatar
bobbie bobbie is offline
Forum Member
 
Join Date: Feb 2005
Location: Mn
Posts: 770
Thats ok . I have a short term memory loss .
I'm not sure why it does it?, I just would close one down and start the one of the other Examples and the music would be playing.
Reply With Quote
  #6  
Old 02-28-2006
Roboblue's Avatar
Roboblue Roboblue is offline
Forum Member
 
Join Date: Dec 2003
Posts: 888
Quote:
Originally Posted by bobbie
Thats ok . I have a short term memory loss .
I'm not sure why it does it?, I just would close one down and start the one of the other Examples and the music would be playing.
The music plays on startup. it is on the background channel.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Menu Bar Woes Roboblue AutoPlay Media Studio 6.0 2 02-05-2008 06:57 PM
More more menu bar Roboblue AutoPlay Media Studio 6.0 10 11-15-2006 01:58 PM
More Menu Bar Roboblue AutoPlay Media Studio 6.0 5 02-06-2006 06:36 PM
Hide Menu Bar Item clubsoda AutoPlay Media Studio 6.0 2 12-09-2005 07:23 PM
TUTORIAL: Showing and Hiding Objects in AutoPlay Menu Studio 3.0 Support AutoPlay Menu Studio 3.0 0 10-10-2002 03:39 PM


All times are GMT -6. The time now is 12:00 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software