0 Replies Latest reply on Aug 11, 2013 10:33 PM by Terrence Tee

    Unable to detect touch in html converted by swiffy because of the bouncing Safari.

    Terrence Tee

      <!doctype html>



            <meta charset="utf-8">

            <meta http-equiv="X-UA-Compatible" content="IE=edge">

            <title>Swiffy output</title>

            <script src="https://www.gstatic.com/swiffy/v5.2/runtime.js"></script>

            <meta name="apple-mobile-web-app-capable" content="yes">

            <meta name="viewport" content="width=device-width, target-densityDpi=device-dpi, initial-scale=1.0, user-scalable=no, maximum-scale=1.0">


                function stopScrolling( touchEvent ) { alert("wa");touchEvent.preventDefault(); }

                document.addEventListener('touchstart', stopScrolling , false );

                document.addEventListener('touchmove', stopScrolling , false );



              swiffyobject = ...........


            <style>html, body {width: 100%; height: 100%}</style>




          <body style="margin: 0;">

            <div id="swiffycontainer" style="width: 100%; height: 100%">



              var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),










      I have a html converted from swf file using swiffy (above). When I view this page in iPhone, the website keeps bouncing in Safari and prevents me from doing more advanced touch detection. I searched on stackoverflow and most answers suggested the same thing: listen to touchstart/touchmove and call preventDefault.


      As shown above i have implemented tat but it doesnt seem to be working at all.

      Any help? How can I prevents the bouncing in safari?


      p/s: I did more research, if I limit the swiffy stage size to a smaller value, e.g. 200x200, then I can see that, if I use finger to try to scroll the non-swiffy area, the browser won't bounce! (because of the javascript preventDefault) But, if I try to scroll the swiffy area, the browser still bounce and thus I still unable to detect touch correctly in swiffy area......