farhanx's Forum Posts

  • My game required to invite friend from the facebook ..I am having difficulty in deciding how to display the friend list of facebook on my game screen?

    Displaying each friend as an object of text+image will take too much time in building,... what is the best way to display image + name + invite button for each user on the screen including scroll bar ... (Do i need to design these things graphically because i do not find any toolbox to do these things except using TEXT and BUTTON object dynamically with vertual back and forth button )

    Kindly give me your best solutions..

  • thanks for your replies guys , but special thanks to bertie Booster who has explained in very precise and with perfect snapshot ...it was not that much hard though but got the proper direction.. once again thanks

  • i have some array of data that i want to display on the screen the data contain user name , country and a picture of the user.

    Now i want to display these information,but i dont know how to generate text label dynamically on canvas...

    if there is any sample or tip then kindly share it...i take the data from webstorage which contain around 20 different user information which i like to show on the canvas...

    any idea???

  •  if(method_ === "POST" && data_ && hdata_)
                   {
                        
                        if (request["setRequestHeader"])
                        {
                             request["setRequestHeader"]("Content-Type", "application/x-www-form-urlencoded");
                             request["setRequestHeader"]("X-UserMail", "faa@kkk.com");
                             request["setRequestHeader"]("X-Number", "hdj2723");
                             request["setRequestHeader"]("X-Token", "80e68a4679e864ec99058b609d29f34523e");
                             
                             
                        //     alert("HDPOST "+request["setRequestHeader"]);
                             
                        }
         
                        request.send(data_);
                   }
    else if (method_ === "POST" && data_)
                   {
                        alert("POST");
                        
                        if (request["setRequestHeader"])
                        {
                             request["setRequestHeader"]("Content-Type", "application/x-www-form-urlencoded");
                        }
                             
                        request.send(data_);
                   }
                   else
                        request.send();
    

    this is the code of the plugin suppose if we dont pass hdata then it will run the second condition where it will not insert header variables so that is why your seeing these values. But if you set header then i am sure you will not able to dump this i guess...

  • thanks for your rapid replies , yes i am using yii for my game...

    I have used the var_dump like as you said on another test page and it displays everything fine if i fetch the page using ajax by test.html javascript...

    but using with construct2 , when I send its header firebug shows it is seems fine but response tab does not display anything..it seems like for some reason whenever i set header and send through construct2 the server variables does not reach including the post variables... but shocking these header values in header and post values in post tab of firebug shows they are being sent successfully through firebug... :( still i dont get it why php code is unable to fetch these values when we use construct2 plugin?

  • Content-Type     application/x-www-form-urlencoded

    X-UserMail     faasmx@kkk.com

    X-Number     hdj2723

    X-Token     80e68a46796cf0085afcb609d29f34523e

    Firebug shows this and my php code other hand is

    Yii::log("NO ERROR m = ".$_SERVER["HTTP_X_Token"]." -- ".$_SERVER["HTTP_X_UserMail"],"MyLog");
    

    above code just write the data in my log file for these varibales and they are coming as null. Previously the same service when i was calling through the web page by passing X-UserMail etc were working fine ...

  • the reaspn why i am not using hdata because i was trying to test first using hardcode values but i was not able to succeeded even using hardcode values.

  • HData entry is just dummy , because i was hardcoding the data to send header values...so in hdata just put anything for now. I have checked in firebug the strange thing is this i cannot see the post script. But since i am logging at my php end so it does come to the php page..seems like my firefox firebug is even not working when i use header value without that it works fine.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • lennaert thanks for your rapid replies , yes i am already using access control ... and i am right now only using construct2 run button which run the application using virtual server ...or i just use localhost/debug to debug...but on any case i do not find header variables which i send to the php page...are you able to receive those variables at php end???

  • lennaert i have tried it but i dont see any error but some concurrent ajax call of ludi ..i will appreciate if you also try and tell me :(

  • I am making a new plugin for myself in which i need to send some extra data through the server header variables. Since the current official ajax plugin does not support this feature i have to create a new by myself.

    But the problem i am facing is , when i set the header variables then it stop posting the data and i see no header variables on my server side script at all.

    the changes what i done is i have just made a new action which takes server header variables... but for the debugging purpose i have added explicitly some header varibales in think it will reach the server...but strangely it never works through plugin. But if i write ajax code in some test html pages and if i apply same way to the header then it works fine.

    I dont understand why it is not working here is the sample of my plugin which is also available on my dropbox shared link

    dl.dropboxusercontent.com/u/104183650/ajaxhd.zip

                   if(method_ === "POST" && data_ && hdata_)
                   {
                        
                        if (request["setRequestHeader"])
                        {
                             request["setRequestHeader"]("Content-Type", "application/x-www-form-urlencoded");
                             request["setRequestHeader"]("X-UserMail", "faa@kkk.com");
                             request["setRequestHeader"]("X-Number", "hdj2723");
                             request["setRequestHeader"]("X-Token", "80e68a4679e864ec99058b609d29f34523e");
                             
                             
                        //     alert("HDPOST "+request["setRequestHeader"]);
                             
                        }
         
                        request.send(data_);
                   }
    
    

    the hdata_ is new header data which fill with some variables but for the sake of testing i have hard coded some header data...the function always gets call and these header settings always works but when i call send then i recieve no POST data nor SERVER variable data...using same stuff with testing page with javascript works fine below is the successful test

    <script type="text/javascript">
    function fetchStatus(address) {
      var client = new XMLHttpRequest();
      client.onreadystatechange = function() {
        // in case of network errors this might not give reliable results
        if(this.readyState == this.DONE)
          returnStatus(this.status);
      }
      client.open("POST", address);
      client["setRequestHeader"]("Content-Type", "application/x-www-form-urlencoded");
      client["setRequestHeader"]("X-UserMail", "faa@kkk.com");
      client["setRequestHeader"]("X-Number", "hdj2723");
      client["setRequestHeader"]("X-Token", "80e68a467969058b609d29f34523e");
           
      client.send("mail=abc@akaka.com");
    }
    
    fetchStatus("http://localhost/myrestapi");
    
    </script>
    
  • Fimbul based on your answer i have made my own custom ajax plugin but strangely it does not work when i use header variables. It is not sending the server variables for some reasons and after spending more than 4 hours i am unable to figure out why...

    But when i tried a simple html page with javascript code and it worked... Both codes are identical but not sure why in C2 prototype object it doesnt work at all...

    if(method_ === "POST" && data_ && hdata_)
                   {
                        
                        if (request["setRequestHeader"])
                        {
                             request["setRequestHeader"]("Content-Type", "application/x-www-form-urlencoded");
                             request["setRequestHeader"]("X-UserMail", "faeeea@kkk.com");
                             request["setRequestHeader"]("X-Number", "hdj2wds2323d723");
                             request["setRequestHeader"]("X-Token", "80e68a46796cf0085afc45067b83273043bb685e864ec99058b609d29f34523e");
                             
                             alert("HDPOST "+request["setRequestHeader"]);
                             
                        }
         
                        request.send(data_);
                   }
    
    
  • is there any plugin available for this type of work???? I am amaze that this is not provided by construct2....suppose if i want to do that then what should be starting point do i need to create new plugin to code javascript?

  • hi,

    I like to set header variables for my ajax call rather than using POST or GET variable.

    Is there a way to do that???

    Note:- i have a rest API that requires me to send HTTP header variables like public key etc. So it is necessary for me to set HTTP header variables

  • Hi,

    I am continuously looking a way to browse the image gallery inside the mobile. So i can set a gamer picture according to it.

    Could anyone point which plugin i should use ? I am not looking to set image from facebook.