cranberrygame's Recent Forum Activity

  • it wasn't c2 bug

    it was caused by the 'alert' action

    thanks

  • Ajax plugin with Group!! doesn't work properly on Windows Phone 8 simulator (or IE)

    Link to .capx file (required!):

    https://dl.dropboxusercontent.com/u/186 ... r164-2.zip (bug_report_20140315_r164-2_2_ajax+group_bug.capx)

    Steps to reproduce:

    1. Create a new project.

    2. Add Ajax plugin

    3. Add event: On "" completed

    4. Add action: Browser.Alert "completed"

    5. Add action: Browser.Alert "message1: repeated forever when Group exists"

    6. Add action: Browser.Alert "message2"

    7. Add Group

    7. Add Button plugin

    8. Add event: On clicked

    9. Add action: AJAX.Request level001.json

    10. Export project-Windows Phone 8 (or Run layout with Preview browser=Internet Explorer)

    11. Test the project on Windows Phone 8 simulator (or Run layout with Preview browser=Internet Explorer)

    12. Click Button

    Observed result:

    If click the button, show "message1: repeated forever when Group exists" alert forever.

    Expected result:

    Alert "completed"

    Alert "message1: repeated forever when Group exists"

    Alert "message2"

    Browsers affected:

    Chrome: no

    Firefox: no

    Internet Explorer: yes

    Operating system & service pack:

    Windows8.1

    Microsoft Visual Studio Express 2012 for Windows Phone

    IE 11

    Construct 2 version:

    R164-2

    ===============================================

    bug fix in event sheet

    => put "System.Wait 0.1 seconds" at AJAX.On "" completed's first line when IE (windowsphone8)

    see bug_report_20140315_r164-2_3_ajax+group_bug fix in event sheet.capx

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

    makes local!!! file ajax in wp8 works well. (commented 6 //cranberrygame comments)

    this code snippet is for previous issue

    thanks

    ...

    try

    {

    //request = new XMLHttpRequest();//cranberrygame (1/6)

    request = new ActiveXObject("Microsoft.XMLHTTP");//cranberrygame (2/6)

    request.onreadystatechange = function()

    {

    if (request.readyState === 4)

    {

    self.curTag = tag_;

    if (request.responseText)

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

    else

    self.lastData = "";

    if (request.status >= 400)

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

    else

    {

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

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

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

    }

    }

    };

    //request.onerror = errorFunc;//cranberrygame (3/6)

    //request.ontimeout = errorFunc;//cranberrygame (4/6)

    //request.onabort = errorFunc;//cranberrygame (5/6)

    //request["onprogress"] = progressFunc;//cranberrygame (6/6)

    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();

    }

    ...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanks for your kind guide.

  • Ajax plugin (XMLHttpRequest) can't load local file, because XMLHttpRequest only works for retrieving network resources. i.e. You cannot use it to access content from your applications local storage, i.e. XAP or IsolatedStorage.

    http://social.msdn.microsoft.com/Forums ... =wpdevelop

    1.please reconsider local!!! file ajax issue in wp8

    ajax-plugin-doesn-t-work-properly-on-windows-phone-8-simulat_t97280

    2.helpful link for resolving this issue

    XMLHttpRequest only works for retrieving network resources. i.e. You cannot use it to access content from your applications local storage, i.e. XAP or IsolatedStorage.

    http://stackoverflow.com/questions/1980 ... -html5-app

    Accessing local file with Ajax on Windows phone 8

    Resolved by adding isLocal:true in the ajax request

    $.ajax({

    url: "page.html",

    dataType: "html",

    async: false, // Otherwise Android 2.2 doesn't show menu

    isLocal: true, // Or Windows Phone will say "Access is denied" to ajax request

    success: function(html) {

    //success code!

    }

    });

    http://stackoverflow.com/questions/1567 ... ws-phone-8

    I'm trying to load templates in WP8 PhoneGap app using jQuery.ajax with options isLocal=true and url="x-wmapp0:www/path/to/file.html". When I use jQuery 1.* all works fine. But using jQuery 2.* ajax returns an error "Error: Access is denied." It is because ajax in 1.* in IE works using window.ActiveXObject("Microsoft.XMLHTTP"). But in 2.* it is use XMLHttpRequest.

    https://issues.apache.org/jira/browse/CB-5003

    Add WP8 support for xhr requests to local files

    https://github.com/enyojs/enyo/pull/234

  • Ajax plugin doesn't work properly on Windows Phone 8 simulator

    Link to .capx file (required!):

    https://dl.dropboxusercontent.com/u/186 ... 6_r163.zip

    Steps to reproduce:

    1. Create a new project.

    2. Add Ajax plugin

    3. Add event: On "" completed

    4. Add action: Browser.Alert "completed"

    5. Add event: On "" error

    6. Add action: Browser.Alert "error"

    7. Add Button plugin

    8. Add event: On clicked

    9. Add action: AJAX.Request level001.json

    10. Export project-Windows Phone 8

    11. Test the project on Windows Phone 8 simulator

    12. Click Button

    Observed result:

    If click the button, show error message (Alert "error")

    Expected result:

    Alert "completed"

    Browsers affected:

    Chrome: no

    Firefox: no

    Internet Explorer: no

    It's working on browser.

    Operating system & service pack:

    Windows8.1

    Microsoft Visual Studio Express 2012 for Windows Phone

    Construct 2 version:

    R163

  • gamesura

    i checked your code but runtime error occurred.

    very thank you.

    p.s even not plugin, if you can replace "REPLACE THIS CODE" to something in main java file, send to me that code.

    i'll apply that code.

    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);

  • guero

    congratulate your success.

    i'm pleased if this plugin helped you.

    keep good things.

    thanks

  • sorry link was mis-typed

    valid download link is following

    dl.dropboxusercontent.com/u/186681453/cranberry_Record/cranberry_Record1.0.1.zip

    thanks

  • Yes, of course good luck!

  • sent to message to flemmig as the following, thanks

    ---------------------

    sorry for late reply.

    unfortunately, current construct2 phonegap plugin is not for phonegap build service (not for cloud).

    if you want to use this plugin, you should download phonegap binary to your pc.

    before build phonegap android project, do the two followings.

    copy src\com\cranberrygame\plugin\Phonegap.java to your phonegap android project (your phonegap android project\src\com\cranberrygame\plugin\Phonegap.java)

    copy res\xml\config.xml to your phonegap android project (your phonegap android project\res\xml\config.xml)

    thanks

  • I think you skipped the following step

    copy src\com\cranberrygame\plugin\Phonegap.java to your phonegap android project

    copy res\xml\config.xml to your phonegap android project

    thanks

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