In my AIR application, I want to animate an HTML element using jQuery. When I attempt the animation in the global HTMLLoader, there is no problem. However, I'm having a problem when attempting to animate elements in a 'secondary' HTMLLoader (i.e. one opened by the original document).
The animation isn't smooth - it only 'steps' when I move the mouse. The animated property (e.g. top
, left
, etc.) is still updated - it just isn't visible unless the mouse is moved. So if I'm not moving the mouse, the animation completes without seeing any transition between the start and end state.
The type of animation doesn't seem to be significant. I've simplified the code to the following:
var loader;
$(function() {
loader = new air.HTMLLoader();
loader.addEventListener(air.Event.COMPLETE, start);
window.htmlLoader.stage.addChild(loader);
loader.load(new air.URLRequest('sandbox2.html'));
});
function start() {
loader.width = loader.window.document.width;
loader.height = loader.window.document.height;
$('.task', loader.window.document).click(function() {
$(this).animate({ backgroundColor: '#c00' }, 1000);
});
}
I tried loading the equivalent HTML/JS into both Firefox and Safari, and it was fine. I'm running Mac OS X 10.5.
Any ideas? Thanks!