How do i save the fact that a button has been clicked.

So im creating a game in which I collect objects that represent money.After I die in the game i get into the Shop Class in which i can buy different items depending on the money i have. So lets say that after dying i have enough money to get item1 and item2. So i Click on button1 (representing item1) andbutton2 (representing item2) (when clicked their alpha gets to 0.5) and start the game again.Ok so now i have 1 life more and i get more money.But suddenly out of nowhere i feel something strange deep in me, something that i have never felt before -> HUNGER,
I shut down the PC and run as fast as possible to the nearest shop.
//lets say item1 is : +1life and item2 is : get more money from objects
After I had satisfied my primal needs I feel the strong urge to play that awesome game of mine again. But when i start the game I start to see some strange things: It seems that I havent got one life moreand neither do i get more money and just to be sure that Im not hallucinating (or that i didnt rememer the lifes i had last time) I die on purpose so the Shop menu shows. So now what I see is making me sad -> button1 and button2 are active and have an alpha of 1( and that means that the game thinks that they were never bought/clicked, that i have never played this game before in my life) So i go crazy (cause all that play before was for nothing and i have to start all over again).
After i calm down, I decide to change my life. 1st BIG change is adding some code into the game. To be more specific: a method that will save the items that i bougth, so when i close the game and start again the things i see will bring joy to my life - >: I still have the items that i bougth last time.
So long story short:
how do i make that when i click a button (it changes its alpha to 0.5)and close the FLA , whenever i open the same FLA, the button that i clicked before will be shown as clicked now(it alpha will be 0.5)
I know it has to be with sharedObject and yet i dont know how
currently i have this:
                        private var savedData:SharedObject = SharedObject.getLocal("sharedStorage12");
                    private var buttonInfoArr:Array = [];
                    private var numberOfSavedObjects:int = 0;
                    private var brokenBtnArray:Array = [];
                    public function Main()
                               for (var i:int = 0; i < 4; i++)
                                        var myImage_mc:MovieClip = new MovieClip();
                                        myImage_mc.graphics.beginFill( 0xFFFFFF * Math.random() );
                                        myImage_mc.graphics.drawRect(0,0,100,100);
                                        myImage_mc.graphics.endFill();
                                        myImage_mc.x = 50 + i * (myImage_mc.width + 10);
                                        myImage_mc.y = 100;
                                        myImage_mc.name = "myImage_mc" + i;
                                        this.addChild(myImage_mc);
                                        myImage_mc.mouseEnabled = true;
                                        myImage_mc.buttonMode = true;
                                        myImage_mc.addEventListener(MouseEvent.CLICK, onClick);
                    private function onClick(ev:MouseEvent):void
                              var thisButton:MovieClip = ev.currentTarget as MovieClip;
                              trace(thisButton.name);
                              thisButton.alpha = 0.5;
                              thisButton.buttonMode = false;
                              thisButton.removeEventListener(MouseEvent.CLICK, onClick);
                              buttonInfoArr.push( thisButton.name );
                              savedData.data.myArray = buttonInfoArr;
How do i use that savedData or how would you do it?
PS: can it be done without Dictionary class, cause i still havent grasp my mind over it.

what do you mean by game-state
PS: i asked this question and they told me to be more specific.

Similar Messages

  • How do I see the group that my contact has been assigned  to when I view the individual contact card?

    I have added my contacts to specifics groups via icloud. I want to be able to see the group my contact belongs to when I bring a contact up (either on my iphone or on icloud).  How can I get the "Group"  the contact has been assigned to to show on their contact?

    what do you mean by game-state
    PS: i asked this question and they told me to be more specific.

  • How can i fix the fact that my phone has no storage when my account after syncing has no storage?

    What can I do to fix the storage on my iphone? after syncing it it says that i have over a GB but my phone says that i have no storage on it.

    Please explain

  • How do I change the fact that my iMessage now lists my email address to reply to instead of phone number or name?

    How do I change the fact that my iMessage now lists my email address to reply to instead of phone number or name?

    Wrong number in iMessage
    simple fix
    go to settings- messages - send and receive- select the numbers and emails you want to use - deselect the ones you don't need
    Peace, Clyde
    if you cant check or uncheck these do this turn imessage off then
    reset all settings
    settings-general-reset-reset all settings
    now reconnect to wifi
    settings- wifi- click network name- enter password - join
    if issue persists back up and restore as new via iTunes
    Peace, Clyde

  • Software update failed how do I save the pictures that are on the phone?

    software update failed how do I save the pictures that are on the phone?

    You should have imported all pics taken with your iphone to your computer regularly as with any digital camera.
    Did you fail to do this?
    You would need to import them if you can.

  • I did not keep the email with my registration for the free trial so I do not have a serial number as I have no products due to the fact that my trial has expired but I would now like to purchase a product and I cannot skip the serial number request.

    I did not keep the email with my registration for the free trial so I do not have a serial number as I have no products due to the fact that my trial has expired but I would now like to purchase a product and I cannot skip the serial number request in order to buy the product it's so irritating I'm about to just do a different product altogether... anyone know how to get or bypass the serial number request?

    You must first make the purchase, then you will receive the serial number you are asking about.  YOu do not acquire the serial number thru the software.  You acquire it thru the purchase, possibly via a follow-up confirmation  email.

  • How do I enable the feature that allows you to left-click and drag cursor left to be same as back button?

    how do I enable the feature that allows you to left-click and drag cursor left to be same as back button?

    Do you mean something like clippings?
    *Clippings: https://addons.mozilla.org/firefox/addon/clippings/

  • How do I determine the # of times a song has been down loaded; 7 is max?

    How do I determine the # of times a song has been down loaded? Is 7 max?

    Jim, I apprecite your help. Im still  lost...not that efficient on computer. Some notes, If burn playlist to disc doesn appear in the menu, it means that the playlist you selected cant be burned to a CD because it contains items that have usage restrictions;  if the playist contains itunes store purchases that are not itune plus songs, you can burn the playlsit to a CD up to 7 times;  DRM - Digital Rights Management????  Any help is appreciated Thank You

  • How can I quit the photos app? It has been trying to create a library for hours but nothing happens. when I try to quit, it won't let me.

    How can I quit the photos app? It has been trying to create a library for hours but nothing happens. when I try to quit, it won't let me. Have just upgraded from iPhotos so don't want to lose any content.

    How can I quit the photos app? It has been trying to create a library for hours but nothing happens. when I try to quit, it won't let me. Have just upgraded from iPhotos so don't want to lose any content.
    Force-quit Photos as recommended by Arsenal1607.
    Make backup of your iPhoto Library and run the iPhoto Library First Aid tools to repair the permissions on your library and rebuild the iPhoto Library.
    To launch the First Aid Tools hold down the  alt/option and the command key simultaneously while double clicking the iPhoto Library to launch the iPhoto Library First aid tools. You'd to hold down both keys firmly and long enough, until the First Aid panel will appear.
    Try both the options "Repair Permissions" and "Rebuild library".  Then try again to migrate the iPhoto Library to Photos by dragging it onto the Photos icon in the Dock.
    Make sure, you have plenty of free storage. Don't try the migration, if you are running out of storage.

  • How to save the data that a user has written in a table (front panel) by using a "press button"?

    Hi,
    I have the following situation. I need to be able to save the data I write in a table (front panel) when desired.
    This allows me to modify, add new data, etc in the "Table" when wanted and to SAVE the latest information when wanted.
    I need to save all the table data by using ONLY one button.
    Thanks for the help!
    Kind regards,
    Amaloa S.

    Hi,
    Thanks for the feedback. :-)
    Your answered helped.
    In this case I need to save the Data into an ARRAY.
    Now I have the following issue. I will try to explain:
    Suppose that I have following:
    1. Several GROUPS of Data like this:
        ER-1234
        ER-3245
        ER-4786
        ER-9080
    2. Each GROUP has the following ELEMENTS:
        A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
       So it would be like
        ER-1234: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
        ER-3245: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
        ER-4786: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
        ER-9080: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
     3. An each ELEMENT has DATA that I need to save, BUT! that I need to be able to get by specifying the group and the element.
        A:
             2,3   2,4    2, 8,   2,8 
             2,2   2,3    2, 7,   2,6
             2,1   2,6    2, 6,   2,7 
             2,5   2,4    2, 5,   2,3
    How can I save the ELEMENT "A" Data with the label of the GROUP and the ELEMENT so that I can recongnize it when I need to get the DATA again?
    Thanks for the help!
    Best regards,
    Amaloa.

  • How can I change the fact that every time I open firefox, I get redirected to a website promising a free ibook?

    OK. So in October I made the mistake of opening a website offering a free iBook (I'm really not gullible; I thought I could figure out who was sending it too me). Ever since then, I cannot open a new Firefox session without being redirected to the site (If I open up more than one webpage and save them before closing, I don't get redirected to the ibook site).
    I actually keep my web-surfing software on thumb drives, and I tried two different thumb drives doesn't matter. I purchased and ran an anti-virus program. No dice. Can you help me?
    I have a MacBook, which runs on system OSX 10.5.8

    Hi revbennyd,
    So it sounds like your home page has been hijacked? You should take a look at the Knowledge Base article [[How to set the home page]].
    There are steps in that article to reset your homepage preferences to default. I would try that first to clear out any strangeness. If that works, you can try setting your homepage again to your personal preference.
    If that doesn't work you should look at the article [[Preferences are not saved]].
    Finally, your issue may be because you've been hit with some [https://support.mozilla.org/en-US/kb/Is%20my%20Firefox%20problem%20a%20result%20of%20malware?s=malware&r=0&e=sph&as=s#w_how-do-i-get-rid-of-malware Malware].
    Hopefully this helps!

  • My computer crashed and I lost my itunes library.  How can I save the sons that are current on my ipod if I plug into a new computer and restore itunes?

    My computer crashed and I lost my entire itunes library.  If I replace the computer and re-load itunes how can I keep all of the music that currently on my ipod?

    Ipod syncing is not one way. You just have to know what to do...
    I can see you use windows. Connect ipod to pc, but don't install or dont open itunes - dont alow itunes to sync automaticly). Then open explorer, enable hidden files, open your ipod (as you would any disc) open hidden file with strange names and copy all of them on your new hard drive. Then drag all this strange-named files in your itunes...woooo...now those strange names become your songs...it is magick
    I you won't i can send you step by step guide...
    Take care.

  • How do you save the info that you write into apps?

    I have entered a lot of info into List Master, and don't want to lose it. Is there an app or program that can save this information?

    App date is stored in the backup that is made every time you sync to your computer. Thus, sync frequently and then separately backup up your computer frequently. The downside is that you can only get the data back by restoring an iPod from that backup. You can't access the data in the backup.

  • How to view the certificate that a component has been signed with?

    Hi all,
    Been using java webstart deployment for a while so understand how to sign and deploy java applications.
    Question I have is how to view the certificate that was used to Sign a jar. For example, if I signed a jar "myComponent.jar" how can I then view the certificate details within this jar. I currently have an old component which I signed with an old certificate and want to view the experation details.
    Thanks in advance
    Simon
    Edited by: simon_seagroatt on Sep 22, 2009 4:20 AM

    You can use command (it will show CN, OU, O, L, etc... and expiration date, of course):
    jarsigner -certs -verify -verbose pathToYourJar.jarI'd suggest redirecting output (>>out.txt).
    Bye.

  • IPod 5th Gen will not recognize the fact that it actually has music on it

    This question has been asked before, but not answered. With that in mind, I will ask you this: Though my iPod does definitely have 18 gigs of music on it, as I can see them when I choose to view it as a portable media device, or whatever, and search manually through windows explorer, it will not recognize the music in either iTunes or on my iPod. I have not restored my iPod because that would be a pain. I have had it for no more than two weeks and this occurrence has made me very upset. It happened when I was working on a playlist. There was a beep sound as if it had ejected and then the black and white screen with the apple came on as if it had been reset. Subsequently, all music disappeared from the iTunes sub menu of my iPod. Furthermore, even though in the "about" on my iPod it says there is music there, I can not see it. When that happened there was a windows message saying that there was a corrupted file and that I should use the "chkdisc" feature. I did that, and nothing was fixed. Please help. Costumer DISSATISFACTION!!!
    iPod 5th Generation   Windows XP  
      Windows XP  

    Welcome to Apple Discussions!
    We are customers too. Sorry if Apple is not SATISFYING you, but we are not Apple.
    If you want to try to "repair" your iPod to get the music to show back up...
    http://www.yamipod.com/main/modules/docs/help/corruptedipod.php
    But again, it would be better to restore. Also, 3rd party software does not always work flawlessly.
    To fix the error that came up, along with getting your music to show back up properly (without the risks of 3rd party software), you need to restore your iPod. If all of your music is on your computer/in iTunes, you won't loose any of it.
    See this for more info...
    iPod: What to do if Windows displays an "itunes.exe - Corrupt File" message
    And if the problem persists...
    Da Gopha: What to do if Windows displays an "iTunes.exe - Corrupt File" message
    If the iPod was just not showing you the songs even though they are there, the first option would be better. However, since you are getting the chkdsk error, you should/need to restore your iPod.
    btabz

Maybe you are looking for

  • Basic Settings for new BW QA Box

    Hi All, i got a problem in BW QA. The BW QA server was a new one. I have created new requests for all the master data infosources and transported them sucessfully. The problem is when i opening the infopackage which was transported to QA i am getting

  • How to write c# to pass parameter with craxddrt.dll?

    any example provided to open crystal report by passing parameter after add reference craxddrt.dll etc. for 8.5 report

  • Universal Dock

    Hello: Perhaps someone can help me with [hopefully] a small problem. I just purchased the Apple Universal Dock and connected it to my 30 year old stereo system using standard RCA jacks. I do not have any power source connected. Problem is that the re

  • Import Informix data into Oracle

    Hi. We have an Informix 7.25 SE database and we need to schedule daily imports of some of its tables into an Oracle 10g database on Solaris. The databases are on different machines. Thank you for your help.

  • [SOLVED] Intel 4000 HD: 3D acceleration?

    Hi guys! I just installed arch linux on my HP Sleekbook, which has a Intel 4000 HD GPU. I've installed xf86-video-intel, intel-dri, libva-intel-driver and lib32-intel-dri. I also edited /etc/X11/xorg.conf.d/20-intel.con and added the tear free config