Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingMobile Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 12th, 2010, 11:34 AM
cjdj3 cjdj3 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2010
Posts: 1 cjdj3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 6 sec
Reputation Power: 0
Question Iphone safari drag and drop flash

Hi

I am creating an iphone webapp with html so that you will be able to play flash games with the latest frash 0.2, and whenever i go to aflash game on mobilesafari thats needs drag and drop, when i drag on the .swf, it scrolls the page however when i drag elsewhere, it doesnt drag. i would like to make it so that when i drag on the flash game it doesnt scroll

the javascript code im trying to use to disable scrolling is:

<script type="text/javascript">

function touchHandler(event)
{
var touches = event.changedTouches,
first = touches[0],
type = "";


switch(event.type)
{
case "touchstart":
type = "mousedown";
break;

case "touchmove":
type="mousemove";
event.preventDefault();
break;

case "touchend":
type="mouseup";
break;

default:
return;
}


var simulatedEvent = document.createEvent("MouseEvent");

//initMouseEvent(type, canBubble, cancelable, view, clickCount, screenX, screenY, clientX, clientY,
// ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);

simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
false, false, false, false, 0/*left*/, null);

first.target.dispatchEvent(simulatedEvent);

//event.preventDefault();
}

function init()
{
document.addEventListener("touchstart", touchHandler, false);
document.addEventListener("touchmove", touchHandler, false);
document.addEventListener("touchend", touchHandler, false);
document.addEventListener("touchcancel", touchHandler, false);
}

</script>

<script charset="utf-8" id="injection_graph_func" src="iphone_files/injection_graph_func.js"></script></head><body onload="init();">
<script type="text/javascript" src="iphone_files/jquery-1.js"></script>
<script type="text/javascript" src="iphone_files/jquery_002.js"></script>
<script type="text/javascript" src="iphone_files/jquery.js">
</script>



Is there a way to make this code target towards the flash object and enable clicking on the flash game?

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingMobile Programming > Iphone safari drag and drop flash

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap