Remembering ON/OFF states in Lingo

I have a series of images 71 total. Each set of images consists of a transparent PNG file the "off" state and a regular PNG file the "on state". I need a presentation that initially has all of the images in the off state but each one gets turned on with a click. Subsequently another click would turn it back off. There are several of these buttons on each page and each one of them may or may not be turned on/off at any time.  As long as I remain on that frame there are no issues, but when I advance to another marker (because not all the images will fit on one page) and return all the buttons return to the initial off state.
I am having trouble with the Lingo. I am using if/then statements on the sprite itself to swap the cast member out and even tried declaring a variable on the Sprite script as well. I was able to successfully remember only 1 button state by using an if then statement in an On EnterFrame so clearly I am not doing this correctly.
Can anyone provide me with some sample code and where to place it in my movie so that I can retain click settings on multiple buttons when navigating back and forth in my movie?

If you want to retain the member state when you leave the span of the sprite then you will need to store the state information in a Global variable. 
You will need a Movie script to setup the global variable and a Behavior that accesses the variable to determine which member to assign to each sprite.
-- Movie Script
global  gBtnStates
on prepareMovie
  gBtnStates = []
  gBtnStates[71] = 0    -- Will fill list with 71 zeros
end
The Behavior uses a GetPropertyDescriptionList() handler to assign an index position into gBtnStates.
-- Button with state memory Behavior
property  pSprite  -- this sprite
property  pIndex  -- index position in gBtnStates for the member state. 0 or 1
global  gBtnStates
On GetPropertyDescriptionList me
  Props = [:]
  Props[#pIndex] = [#default:1, #format:#integer,  #comment:"Member state Index."]
  return Props
end GetPropertyDescriptionList
on beginSprite me
  pSprite = sprite(me.spriteNum)
  me.changeMember()
end beginSprite
on mouseDown me
  gBtnStates[pIndex] = Not gBtnStates[pIndex]
  me.changeMember()
end mouseDown
on changeMember me
  if gBtnStates[pIndex]  then
    pSprite.member = member("member1")
  else
    pSprite.member = member("member0")
  end if
end mouseDown

Similar Messages

  • K8NGM2-FID and USB ports when off state

    I have a light "problem" which seems to come from the mobo.
    I'm using an iMon Knob remote controller (http://www.soundgraph.com/pr/e_pr_3.asp?m1d=1&m2d=3).
    The receiver is connected in USB to the mobo.
    Under operation, it emits a blue light permanently and flickers for each key hit.
    The problem is that, when I shutdown my HTPC completely, the blue light remains lit.
    The manufacturer sent me this explanation:
    Quote
    KNOB led lights on when USB 5V is active. When system is off state, generally in most of M/B USB 5V is inactive , but in your system USB 5V is active.
    Please update your M/B BIOS to the latest version.
    Is it relative to a BIOS parameter (3.20) ?
    It does not occur on my other PC.
    Thank you.

    Deckard,
    It sounds like you have a BIOS Parameter set which keeps some juice in the USB Bus while your system is powered down. (Remember ATX Spec does not turn fully off like the old bATX used to.) It could be that you have Wake up on LAN, USB Keyboard settings with a Wake Setting, there are several options in the BIOS that can do this.
    I would start with the manual and go though the BIOS Settings.
    Take Care,
    Richard

  • Is it possible to deploy a process in "OFF" state?

    Is it possible to deploy a process in "OFF" state?

    Hi Chris,
    Looking through the BPEL client API, I think it might be possible to change the process state via java code. I say might, because the documentation is not that splendid. The IBPELProcessHandle interface has a method updateMetaData which allows you to change the state, among other things. I have not tried this yet so the solution a little theoretical.Sorry for that :-\
    Then, when you have your java class working, you can create an Ant task for it and invoke your Ant task in the build.xml, right after the deployment target.
    Kind regards,
    Harm

  • Fixed: How to remember the DataTable state and still use buttons

    Lets say that you have a DataTable on a page, with a bunch of hyper links and buttons on the same page (for navigation to various parts of your application). If you use the built in pagination and sorting, you will find that the following behaviour:
    1. DataTable remembers its state (sorting, page number, etc.) if you click on any hyper link. You can even go back to a different page, and then come back to the original page to find that your DataTable is in the state you left it (very cool, it is session scope and works as intended).
    2. If you click on any button, DataTable does not remember its previous state (goes back to page 1 and default worting, etc.). After playing around with it and going nuts, I discovered the way to use Button and still have the DataTable remember its state. I wanted to share it with the rest of you:
        public String btnClose_action() {
            try {
                this.getExternalContext().redirect("faces/users.jsp");
            } catch (Exception ex) {
                log("Error: userDetail > btnClose_action", ex);
            return null;
        }This was my original post:
    http://swforum.sun.com/jive/thread.jspa?threadID=103583
    Message was edited by:
    Sabir

    II think there should be a property
    to disable form submission on buttons. There is!
    To make the form not be submitted by a button click:
    1. In the Visual Designer, select the button.
    2. In the Properties window set the JavaScript > onClick property to return false;
    This might interest you: http://blogs.sun.com/divas/entry/disabling_a_button_after_it

  • Wireless Switch stuck on the OFF state

    Hello! About 2 months ago I switched to the Windows 10 preview and would experience Internel_Power_Error, whatever not a big deal it was once every so often so it didnt bother me too much, then after Windows 10 came out I was experience this error all the time making my laptop effectivly a paper weight. I set the laptop aside since, today I pulled it out and grabbed my Windows 7 Install CD as well as the PowerSpec Driver CD. I was able to successfully go back to windows 7, but for some reason the Built-in switch to toggle Bluetooth and Wireless is stuck on the OFF (Orange/Amber) state. I have a second computer so I was able to research and transfer via USB the correct Ethernet drivers. However my laptop is still indicating that there are no connections available. My Ethernet and wireless Controller, QualComm Atheros QCA9565 802.11b/G/N WiFi Adapter:PCI\VEN_10EC&DEV_8168&SUBSYS_1944103C&REV_0CShould have driver: SP64676However when I try to install this driver it completes its install and says the driver was not installed correctly. I also have PCI Device which is missing a driver acording to the Device Manager:PCI\VEN_10EC&DEV_5227&SYBSYS_1942103C&REV_01 As well as an unknown Device:ACPI\HPQ6007 Is it possible that due to the Switch being in the OFF state these drivers are not able to install properaly? If so how do I go about disabling the Switch completly so the button has no effect on the computer whats so ever? Thank you for your time, I have looked at so many threads and tried everything I could so if anyone can point me in the right direction that would be wonderful! -Andrew

    I really need some help here, I have a $900 paperweight sitting on my desk collecting dust. If anyone has any ideas no matter how crazy it is, I will try it. -Andrew

  • My IPad is getting to off state/sleep state by itself and no response

    I am using iPad 4, it is getting to off mode often and get on only after hard  restart and also some times hard restart is also not working for few hours, it started to me two weeks before and happening often. is this happening for any of you? Is this software issue or hardware issue? How it's resolved for you, how to apply for warranty claim on this, This is my first apple product and now I am surprised of this issue by the best product in the world and awaiting your replies and suggestions

    Try resetting the device to original factory settings. If that doesnt work try resetting holding the sleep and home button until the start up screen shows up.

  • Spool file contains spool off; statement and a / in it .how to remove these

    Hi ,
    I am new to using forums.
    I am a basic beginner user of oracle .
    I need to spool the output of 2 select queries into a file.
    I could achieve it.
    But the file also contains ,
    SPOOL OFF;
    in it . How to avoid these in the file.
    Any help is appreciated .
    thanks

    user11768287 wrote:
    Hi
    I checkout and created a .sql file .
    But the spool file , contains an empty line after every record is printed. These are the heading i am using.
    SET HEADING OFF
    SET ECHO OFF
    SET TERMOUT OFF
    SET VERIFY OFF
    SET FEEDBACK OFF
    The spool file starts with a blank line followed by the record and then blank line after every record .
    What to do to get all records one after the other without blank lines in between the records in the spool file.
    In addition to Toni's mention of PAGESIZE and TRIMSPOOL, look at LINESIZE. Also, what are you using to view the spooled file? Are you sure you aren't just seeing line wrap within that application - like Notepad?
    Thanks ...

  • How flash can remember the hit state of buittons

    How can you use a cookie- flash shared object to remeber the
    hit state of a flash button.
    example: the button is red, once clicked it goes green.-
    stop. when the page is refreshed all the buttons go back to red but
    i want them to stay green.
    CODE BEING USED: Note: timer 15seconds for testing:
    on (press) {
    var currentDate:Date = new Date();
    var so:SharedObject = SharedObject.getLocal("tank");
    if(so.data.name != undefined){
    trace("the cookie already exists");
    gotoAndStop(2);
    trace("The expiry date of the cookie is: " +
    so.data.expirydate);
    if(currentDate > so.data.expirydate){
    trace("delete the shared object");
    so.clear();
    }else{
    trace("set the cookie");
    so.data.name = "tank2";
    so.data.expirydate = new
    Date(currentDate.getTime()+1500000);
    trace("The expiry date of the cookie has been set to : " +
    so.data.expirydate);
    WHERE IT SAYS: GOTOANDSTOP (2), WHAT I WANT IS IT TO GO TO
    THE HIT FRAME WITHIN THE BUTTON.
    NOT EVEN SURE THIS WILL WORK SO ANY COMMENTS MUCH
    APPRECIATED!!
    THANKS ALL

    Sorry i was very wrong, still having problems any ideas???
    anyone!
    followed guide:
    http://board.flashkit.com/board/showthread.php?t=725302&highlight=shared+object+expiry
    but still running into issues. can anyone explain it to a
    child (me)

  • Power Supply "Powered-Off" State

    I have power supplies in Slot 1 and Slot 2.
    Both power supplies show fully operable (power, voltage, etc) in details, however the Slot 1 power supply shows "Powered-Off"
    I have tried both N+1 and Non-Redundant power policies.
    Thanks for help in advance.

    Should be Non-Redundant with only 2 supplies.  Once selected try to re-acknowledge the chassis.  I was set these global polices first off, power and uplink # and save, acknowledge and allow time to discover and update.  What rev you using ?  Not sure of exact rev's but saw several power supply and fan bugs resolved in newer 1.4(3) code.

  • Password remembering turned off

    Not fixed I read another post on the same subject.
    Will follow this . Look for the topic : "can't save my password for websites; invitation to save doesn't come up".
    I upgraded to 3.6.8.
    When i log in on specific sites my login name is remembererd , not the password.
    Passwords are still there ( saved passwords), tried to install the option 'remember passwords etc' but no luck ( every time I checked whether the option is still there its gone).
    I even deleted the phishing options from Bitdefender.
    I tried to install the 'old version' 3.5, same results.
    All the privacyoptions are like they should be.
    No luck , no big deal, just a little annoying

    When I type the first character of the login name, it will be remembered, wonder if that is a cookie, could be.
    Thanks for the suggestion, it doesn't work unfortunately.
    Also when I try ( tools/options/security/remember password ) next time I choose the same option my selection vanished. So remembering passwords isn't possible.

  • FireFox remembering last website state, even after restarting, clearing history, cookies,cache etc. No other does this (IE,Chrome,Opera...)

    On the website, after 3-4 login attempts and an error message appears. You cannot retry unless you exit out of the browser(s) completely.
    I closed all FireFox browsers, opened a new browser and cleared Recent History will all checked. Closed the browser and restarted the browser again. Going to the website, the error message page is displayed and not the login page.
    With IE (also Chrome and Opera), after closing all the browser window(s) and restart browser and then go the website, I get to the login page, not the error message page.
    It sounds like FireFox is keeping something around (even after clearing everything out) and the website is remembering you in some way.

    -> Tap '''ALT''' key or press '''F10''' to show the Menu Bar
    -> go to Help Menu -> select '''Restart with Add-ons Disabled'''
    Firefox will close then it will open up with just basic Firefox. Now do this:
    -> go to View Menu -> Toolbars -> unselect All Unwanted/Incompatible Toolbars
    -> go to Tools Menu -> Clear Recent History -> '''Time range to clear: select "EVERYTHING"''' -> click Details (small arrow) button -> place Checkmarks on ALL Options -> click '''Clear Now'''
    -> go to Tools Menu -> Options -> General -> '''When Firefox starts : select "Show My Home Page"''' and click '''Reset to Default''' button
    -> go to Tools Menu -> Options -> Privacy -> History section -> '''Firefox will: select "Remember History"'''
    -> go to Tools Menu -> Options -> Security -> place Checkmarks on:
    1) Warn me when sites try to install add-ons 2) Block reported attack sites 3) Block reported web forgeries
    -> go to Tools Menu -> Options -> Advanced -> General -> Remove Checkmark from '''Warn me when websites try to redirect or reload the page'''
    -> go to Tools Menu -> Options -> Advanced -> Network -> Offline Storage (Cache): click '''Clear Now''' button
    -> Click OK on Options window
    -> go to Tools Menu -> Add-ons -> Extensions section -> REMOVE All Unwanted/Suspicious/Incompatible Extensions (Add-ons)
    -> go to Tools Menu -> Add-ons -> Appearance section -> REMOVE All Unwanted/Suspicious/Incompatible Themes (Persona)
    -> Restart Firefox
    You can enable your Known & Trustworthy Add-ons and Themes later. Check and tell if its working.

  • Is inactive analog output will be at high impedance or cut off state?

    Hey 
    I'm using the NI 6229 analog outputs.
    I would like to know if there is a tri-state or high impedance state for those  analog output when it is not in use? 
    Solved!
    Go to Solution.

    Hello amco,
    From the description of your project, I'm envisioning two probes attached to different points along a single trace on a PCB.
    It is certainly not recommended to have two analog output lines attached to the same channel.  As you have experienced, the behavior is unpredictable.  In a worst-case-scenario, one could potentially damage the AO line that is not actively driving the channel.
    So we do need to find a configuration that makes the unusued AO channel electrically separated from the channel-under-test.  One option would be to introduce an electromechanical switch.  This will add some complexity to your setup and your code, but it will permit you to send the signal from AO-0, disconnect AO-0, connect AO-1 and send a signal from AO-1 — all in a very short amount of time.
    Best regards
    Matthew H.
    Applications Engineer
    National Instruments

  • My iphone has been lost ....please can u track where is it.the device is in off state..please notify me n thanks a lot..

    please tell me where is that cell..i m in tension sir..

    Goonzs, please note you are not addressing Apple here.  This is a user forum.
    Moreover, Apple cannot track your iPhone, but please note that if the power is off the iPhone cannot be tracked.
    Change all your passwords to items that are on your iPhone, report the stolen iPhone to the police and to you carrier.  Some carriers will blacklist the iPhone's imei number so that it cannot be reconnected to that network.
    If you had Find my iPhone enabled on the iPhone, you could try to locate it through iCloud but the phone needs to be powered ON and connected to the Internet to be found.

  • Volume control, remember state possible?

    Hi All
    Is it possible to get flash to remember its volume state over multiple web pages? I have a flash header with background sounds, I want to make it possible to have an off button or volume button. Is there a component or something?
    Thanks
    Ste

    Yes, you do that with a flash cookie (called "shared object" in flash language)
    Emil Georgiev - Flash & Web Design

  • [SOLVED]KDE does not remember window state, restoring from System Tray

    Hi,
    I'm facing a problem with some KDE applications that dock in the system tray, like Amarok and Konversation. I like to keep these apps maximized. But when I restore them from the system tray, they always revert back to their original, unmaximized size. Is there any workaround or fix for this?
    Using KDE 4.3.4-2 (not KDEmod)
    Thanks.
    Last edited by codemon (2009-12-08 08:56:16)

    Funny thing happened. I tried out your suggestion for my Firefox window, which would always start in an un-maximized state. It worked perfectly. Then I opened up Konversation and Amarok, and found that they properly remember the window state now!
    Thanks for the help.

Maybe you are looking for

  • Unable to start presentation services , in OBIEE 11g

    Hi , Unable to start presentation services , in OBIEE 11g : [2013-01-18T13:38:49.000+05:30] [OBIPS] [INCIDENT_ERROR:1] [] [saw.webextensionbase.init] [ecid: ] [tid: ] Invalid item /system/mktgcache/01HW447397/sawguidstate.[[ File:catalogimpl.cpp Line

  • Execution time of IVI Steps

    Hello, We have made some benchmarks to decide the usefulness of TestStand IVI steps versus Labview ones with a PXI 4070 ( DMM ). The Labview steps ( using also IVI access !!! ) are 30% faster than direct TestStand IVI steps. May someone help us to un

  • Service to call a SAP Transaction from cProjects

    Hi,    After accounting Integartion, I wanted to call some transaction already in "Service for an SAP Transaction" node. There I need to define the Parameters and Services to make it available thru Portal. But seems I'm not able to provide the exact

  • SimpleDeserializer encountered a child element ... Please HELP!!!!

    Good Morning Everyone, I want to thank you for reading my problem and see if you can help me. The deadline for this project is monday and I am struggling to make it work. I am using axis 1.4 . I created the web method public void GetFilters( javax.xm

  • Imessage sending via email.

    My iphone 4s is sending my imessages through my email. When I checked it, my number is grayed out and I cannot select it. This has happened before and my friend fixed it, but neither of us can remember how she did and I feel like I have tried everyth