cranberrygame's Recent Forum Activity

  • Link to .capx file (required!):

    dl.dropboxusercontent.com/u/186681453/bug_report/1/bug_report_20131111_r149.zip

    Steps to reproduce:

    1. Create a new project.

    2. Add Ajax plugin

    3. Add event: On "" completed

    4. Add action: Browser.Alert "complete"

    5. Add Button plugin

    6. Add event: On clicked

    7. Add action: AJAX.Request level001.json

    8. Export project-PhoneGap

    9. Test the project on iOS simulator

    10. Click Button

    Observed result:

    If click the button, no response. (no alert)

    Expected result:

    Alert "completed"

    Browsers affected:

    Chrome: no

    Firefox: no

    Internet Explorer: no

    It's working on browser.

    Operating system & service pack:

    Mac OS X 10.7.4

    iOS simulator Version 6.0 (369.2)

    phonegap 2.9.0

    Construct 2 version:

    R149

    cf)

    i modified

    C:\Program Files\Construct 2\exporters\html5\plugins\ajax\runtime.js

    as followings (two line, maked "//cranberrygame" beside it)

    and then works well on iOS simulator

    ...

              try

              {

                   request = new XMLHttpRequest();

                   request.onreadystatechange = function() {

                        // Note: node-webkit leaves status as 0 for local AJAX requests, presumably because

                        // they are local requests and don't have a HTTP response. So interpret 0 as success

                        // in this case.

                        //if (request.readyState === 4 && (isNodeWebkit || request.status !== 0))//cranberrygame

                        if (request.readyState === 4)//cranberrygame

                        {

                             self.curTag = tag_;

                             

                             if (request.status >= 400)

                                  self.runtime.trigger(cr.plugins_.AJAX.prototype.cnds.OnError, self);

                             else

                             {

                                  self.lastData = request.responseText.replace(/\r\n/g, "\n");          // fix windows style line endings

                                  

                                  // In node-webkit, don't trigger 'on success' with empty string if file not found

                                  //if (!isNodeWebkit || self.lastData.length)//cranberrygame

                                  if (self.lastData.length)//cranberrygame

                                       self.runtime.trigger(cr.plugins_.AJAX.prototype.cnds.OnComplete, self);

                             }

                        }

                   };

                   request.onerror = errorFunc;

                   request.ontimeout = errorFunc;

                   request.onabort = errorFunc;

                   request["onprogress"] = progressFunc;

                   

                   request.open(method_, url_);

                   

                   // Workaround for CocoonJS bug: property exists but is not settable

                   try {

                        request.responseType = "text";

                   } catch (e) {}

                   

                   if (method_ === "POST" && data_)

                   {

                        if (request["setRequestHeader"])

                        {

                             request["setRequestHeader"]("Content-Type", "application/x-www-form-urlencoded");

                        }

                             

                        request.send(data_);

                   }

                   else

                        request.send();

                   

              }

              catch (e)

              {

                   errorFunc();

              }

         };

    ...

  • asmina22

    i tried to create PhonegapAD plugin.

    but that blocked me.

    if that solved, the plugin you want will come out.

    welcome to scirra.

  • i am author of Phonegap plugin. (http://www.scirra.com/forum/topic74901.html)

    i can create the plugin called PhonegapAD if you help me.

    without use of activity.root member (root is not public member, so compile error occurs)

    use other activity's member and get layout

    in "REPLACE THIS CODE" line, what other code you can put?

          adView = new AdView(activity, AdSize.BANNER, "a1503e07f0254b1");

                        

          LinearLayout layout = activity.root;//compile error//REPLACE THIS CODE

          layout.addView(adView);//bottom

          layout.setHorizontalGravity(android.view.Gravity.CENTER_HORIZONTAL);

          AdRequest request = new AdRequest();

          adView.loadAd(request);

  • i met same problem.

    and used dictionary for the purpose of simplicity.

    attached capx

    dl.dropboxusercontent.com/u/186681453/reply/1/buttoncssstyle_dictionary.capx

  • pcp

    added feature you need.

    great, your fast canvas phonegap plugin will be much helpful to the performance sensitive game.

    thanks.

  • this plugin support both socre (highest score) and time (lowest time).

    (added time example capture)

    as for score , this is equal to westorage in ease (or westorage is much easier).

    but (1) this plugin powers up if applied to time (lowest time).

    plugin's "Record Is not lower than" encapsulates the following code in javascript.

    ...

    return (record==0) || (record > time);

    record==0 condition (0 threshold) is not easy to think of.

    (2) this plugin don't need to invent westorage's key naming (just create Record Object).

    and as for many kind of difficulties, just use as this RecordBeginner,RecordIntermediate,RecordExpert. (don't need to invent westorage's key naming)

    i think this two advantages are useful.

    if i missed , guide me.

    thanks.

  • did you modify the event and test?

    i tested example_level.capx and works well.

    and added example_level_message_summary.capx for further understanding for play layout's event handling about level.

    if your problem was not solved , post comment again.

    thanks

  • EncryptedCow , you have good question.

    if only one sprite , nothing is different or advantageous.

    but when sprite numbers are over 3 sprites, then this (this plugin) is far simple. (for example, summary message)

    main purpose of this plugin is to support summary message.

    i posted summary message code capture in example 1.

    thanks

  • [plugin] Record

    1.overview

    provide functionality to record socre (highest score) and time (lowest time) in local.

    2.download

    this plugin is deprecated.

    3.function

  • added basic example (example_message.capx)

    have good time

  • this plugin provides functionality to show summary message (for example, success,fail,pause) and navigation button.

    for real example, see the following.

    scirra.com/arcade/puzzle/5014/predict-ball

    have good time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [behavior] MessageBox

    1.Overview

    show and hide message box

    2.API

    3.Examples

    example capx are included in doc folder

    4.Download

    download

cranberrygame's avatar

cranberrygame

Member since 23 Jun, 2013

Twitter
cranberrygame has 4 followers

Connect with cranberrygame

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies