Javascript Problem

  1. 4 years ago

    Hi,

    I used Javascript to randomize some events, It worked perfectly when I previewed the project on pubcoder

    But.. when I published the project as an android app, the javascript didn't work correctly, it only executed the first event and didn't execute the rest... We tried viewing the epub file on an iPhone and the same problem happened.

    below is an example of the used code:

    $("#obj431").trigger(PubCoder.Events.TouchDown)
    $("#obj433").trigger(PubCoder.Events.TouchDown)
    $("#obj435").trigger(PubCoder.Events.TouchDown)

    on the pubcoder preview, the code works fine, on an iPhone as an epub, or on the android as an app....
    Only the first line is executed

  2. Paolo A

    4 Nov 2016 Administrator

    Try to put it asynchonously through a setTimeOut with different timings for each, just an attempt:

    setTimeOut(function() { $("#obj431").trigger(PubCoder.Events.TouchDown) }, 10);
    setTimeOut(function() { $("#obj433").trigger(PubCoder.Events.TouchDown), 20);
    setTimeOut(function() { $("#obj435").trigger(PubCoder.Events.TouchDown), 30);
  3. Hi Paolo,

    After changing the event from TouchDown to TouchUp, the code worked without a problem, I don't know why, maybe it is a bug with the program

  4. I am having almost the same issue; when I use the Show event to trigger actions it doesn't work on my Android (4.4.2) smart phone but when I change it to Load it works fine.

    Right now actions like MoveObject are not working. Is it a javascript issue ? I am currently trying to figure out what is compatible and what is not within actions and events.

    The preview or Html5 output work fine.

    Thanks for the assistance.

  5. I have checked on another phone (Android 6) all features are working fine I guess it is a compatibility issue.

 

or Sign Up to reply!