Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 253
Registered: ‎08-14-2010
My Device: Not Specified

SVG animation does not work

Hi,

 

I created a SVG animation file using Composer 5.0.

 

I used switch group facility using .png files.

 

The priview works properly in Composer 5.0.

 

I  created an app using following code.

 

 

InputStream svgSource = getClass().getResourceAsStream("/Try.svg");
SVGImage image = null;
try {
image = (SVGImage)ScalableImage.createImage(svgSource, null);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
SVGAnimator animator = SVGAnimator.createAnimator(image, "net.rim.device.api.ui.Field");
   Field field = (Field)animator.getTargetComponent();
add(field);
animator.play();

 

 

 

BUT MY SVG ANIMATION DOES NOT PLAY  

 

But when I replace with the SDK demo sample.svg file it works . what can be wrong? I have attached the svg file generated by Composer 5.0. Please help.

 

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by Plazmic Composer Version:  4.1.0.19  - Apr  3 2009 -->
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2000/svg http://www.plazmic.com/svg/schema/svg.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:pz="http://www.plazmic.com/plazmic_svgt_extents"
 id="Untitled_07" version="1.1" baseProfile="tiny" xml:space="default" width="100%" height="100%" viewport-fill="#ffffff" viewBox="-180 -240 360 480" preserveAspectRatio="xMidYMid meet">
<g  id="Layer_1">
	<!-- pz:tag type="layer" -->
<defs>
	<!-- pz:tag type="group" -->
<image id="_1_png_1"
	x="-35" y="-35" width="70" height="71"
	xlink:href="Images/_1_png_1_img_1_2.png"/>
<image id="_2_png_2"
	x="-35" y="-35" width="71" height="71"
	xlink:href="Images/_2_png_2_img_1_2.png"/>
</defs>
<use id="Group_1" xlink:href="#_1_png_1"/>
</g>

<!-- pz:tag output="anim" -->

	<animate xlink:href="#Group_1" id="_anim_1" attributeName="xlink:href" calcMode="discrete"
		values="#_1_png_1;#_2_png_2"
		keyTimes="0;1"
		dur="0.05s" fill="freeze"
	/>
</svg>

 

 

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: SVG animation does not work

What BlackBerry Smartphone model and BlackBerry device software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 253
Registered: ‎08-14-2010
My Device: Not Specified

Re: SVG animation does not work

8520 and 9520 .

 

The demo app animation is working on both devices .. but not the animations I created using composer 

Developer
Posts: 253
Registered: ‎08-14-2010
My Device: Not Specified

Re: SVG animation does not work

8520 version is 5.0.0.681

9520 version is 5.0.0.497

Highlighted
BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: SVG animation does not work

Have you tried a custom SVG image that doesn't reference external image files?  Were these images packaged within your application?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker