Forum General Coding help

Any issues or discussions relating to Flash development are welcome here.

Coding help

Postby 12345hassan » February 9th, 2018, 8:03 am

Can someone help me to code some thing? Please!
I need to add "Suggestion"in my game
when the person clicks ok btn the text he entered should be saved in db i have tried to code it but i failed the code i user :
Code: Select all
suggestIt.oksend.addEventListener(MouseEvent.CLICK, function () {
                                     //var e:MouseEvent = _arg1;
                                     TheClient.bigDB.loadOrCreate("Suggestion", "fb" + fbuid, this.suggesth, null);
                                    TheConnection.send("suggested", suggestIt.textrequest.text);
                                    trace("umm");
                                    alert(suggestIt.textrequest.text);
                                    
            
         Tweener.addTween(suggestIt, {
                        "x": 999999,
                        "x": 999999,
                        "time": 0.2
                     });
      
       });
      function suggesth(kotaa: DatabaseObject): void
      {
         this.user = kotaa;
         
         if (kotaa.Suggestion == null)
         {
            kotaa.Suggestion = suggestIt.textrequest.text;
         
         kotaa.save();
      }
      }

in as3 i use this code and in
C#:
Code: Select all
case "suggested":
                    {
                        PlayerIO.BigDB.LoadOrCreate("Suggestion", player.ConnectUserId, delegate(DatabaseObject shit)
                        {
                            //var fbname = name.GetString("fbname");
                            shit.Set("Suggestion", message.GetString(0));
                            //shit.Set("FbName", fbname);
                            shit.Save();
                        });
                    }

Please Help
12345hassan
 
Posts: 44
Joined: August 5th, 2016, 11:40 am

Re: Coding help

Postby robscherer123 » February 9th, 2018, 2:52 pm

Have you put any traces in to help you figure out what is firing and what is not? Is the "umm" being called that you enter? Is the message being received on the server end? Is the LoadOrCreate call being triggered for sure as well? At quick glance it looks like that should work, but there could be other issues I can't see.
robscherer123
Paid Member
 
Posts: 313
Joined: December 12th, 2012, 8:46 pm

Re: Coding help

Postby 12345hassan » February 10th, 2018, 10:28 am

Fixed thank you for your reply, I coded it in as3 client using documentation
12345hassan
 
Posts: 44
Joined: August 5th, 2016, 11:40 am

Re: Coding help

Postby johnnixon » November 13th, 2019, 9:01 am

Well i m here for the same. I code it by your method, it works out now. TKS
johnnixon
 
Posts: 2
Joined: November 12th, 2019, 1:50 am

Re: Coding help

Postby timrim » April 13th, 2022, 8:40 am

Check all the latest updates on elections, latest viral videos, viral memes, world top trending news, Today's trending events, and latest fashion trends.
timrim
 
Posts: 2
Joined: April 13th, 2022, 8:38 am


Return to General