Archived:JSR-226 - Animation may not start when calling SVGAnimationElement.beginElementAt(0.0f) (Known Issue)
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.
Article Metadata
Compatibility
Platform(s): S60 3rd Edition, FP1 MIDP SDK
Article
Created: User:Technical writer 1
(31 Aug 2007)
Last edited: hamishwillee
(01 Jul 2012)
Description
When using the Scalable 2D Vector Graphics API, the animation may not start when calling the SVGAnimationElement.beginElementAt( 0.0f ) method. This happens when an animation for an element is controlled by two chained <animateTransform> elements.
How to reproduce
This issue affects JSR-226 when running on the emulator.
<rect x="30" y="30" width="30" height="30" fill="yellow">
<animateTransform id="animRect1_1" type="translate"
attributeName="transform" attributeType="XML" fill="freeze" begin="indefinite"
dur="2s" restart="always" from="0,0" to="30,30"/>
<animateTransform id="animRect1_2" attributeName="transform"
type="translate" attributeType="XML" fill="freeze"
begin="button_play_focus_on.end" dur="1s" restart="always" from="30,30"
to="0,0" fill="freeze"/>
</rect>
<rect x="80" y="30" width="30" height="30" fill="red">
<animateTransform id=" id="animRect2"" type="translate"
attributeName="transform" attributeType="XML" fill="freeze" begin="indefinite"
dur="2s" restart="always" from="0,0" to="30,30"/>
</rect>
SVGAnimator.invokeLater(new Runnable() {
public void run() {
Document doc = svgImg.getDocument();
SVGAnimationElement el =
(SVGAnimationElement)doc.getElementById("animRect1_1");
el.beginElementAt(0.0f);
el = (SVGAnimationElement)doc.getElementById("animRect2");
el.beginElementAt(0.0f);
}
});
Expected outcome:
Both boxes move to the bottom-right corner in sync.
Actual outcome:
The animation works only for the very first time. In all subsequent iterations the smooth movement of the yellow box towards the bottom-right corner is skipped and the boxes do not move in sync.
Solution
This issue is fixed in S60 3rd Edition, FP2 MIDP SDK.


(no comments yet)