Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Javascript slow when running in an UIWebView

Hi there...
I am developing an app for a client of mine, despite the wide array of tools available though objective c, they (the client) has insisted that we use rudimentary web technologies (HTML, Javascript etc) for the program, I believe they are looking to save development costs on ports to other platforms.

I wrote an animation routine in javascript which runs great in Safari on the desktop but very slow in both iphone and ipad (code included below) we were able to resolve a graphic rotation (rotating a large picture clockwise) issue by using css3 animations and key frames in the webkit, but this animation which consists of a series of bitmapped images (png files) was not supported that I could find. Any advice would be greatly appreciated.

Thanks

------

var dieNum;

function dieLaunch(){

// var dieImageSet5 = 19; // total 83

dieNum = 0;
dieTimer = setInterval("dieAnimation(5,19)",40);

}

function dieAnimation(set,end){

var fNameNum;
var fPath;

if(dieNum<=9){<br /> fNameNum = "0000" + dieNum;
}else{
fNameNum = "000" + dieNum;
}

fPath = "url(graphics/dieImages/" + set + "/roll_" + set + "_" + fNameNum + ".png)";

document.getElementById('dieStage').style.backgroundImage = fPath;
dieNum++;
if(dieNum > end){
clearInterval(dieTimer);
movePlayer(dieRand);
}
}
Post edited by lmpeejay on
PJ Dahill

pdahill_at_gmail.com



Follow my romp through the world of finding a contract job in this economy on Twitter at "HiTechJobSeeker"

Replies

  • dljefferydljeffery Posts: 1,311iPhone Dev SDK Supporter, Registered Users
    How about using HTML5 animations? (Please excuse my ignorance if that is what you are already doing... although I don't think it's what you're doing, but I'm a complete HTML noob.)

    Here are a couple tutorial videos for Hype:

    Tumult Hype Tutorials

    I have no connection to Hype. Just read about its release a while back, watched the videos, thought it was cool and might prove useful (or just fun) someday, so I bought it on the Mac App Store.

    Honestly I've only fired it up a couple times; haven't had time to really play around with it yet. Although I did just spend a few minutes playing with it just now in order to see how easy it was to rotate an image clockwise.
    Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

    Recall It! for iPad
Sign In or Register to comment.