Skip to main content

Microsoft Silverlight

Answered Question Problem in trying to set up a sprite animationRSS Feed

(0)

valiant
valiant

Member

Member

25 points

19 Posts

Problem in trying to set up a sprite animation

Hi everyone. I came across a visual problem when I try to emulate a sprite animation (displaying images one after eachother) using blend. I'm putting my images in a container and by default I set their visibility status to collapsed and then I create a visual state where I change the images' visibility states frame by frame. The result is a animated image when set to this certain state. The animation displays fine in blend editor but when I display it in the site all the images visibility status remain visible and image lefts a trail while animating. Sample xaml code is below. What might be the problem?

<vsm:VisualState x:Name="CanEvRollOver">

<Storyboard RepeatBehavior="Forever">

<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="canev0" Storyboard.TargetProperty="(UIElement.Visibility)">

<DiscreteObjectKeyFrame KeyTime="00:00:00.0250000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Collapsed</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

</ObjectAnimationUsingKeyFrames>

<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="canev1" Storyboard.TargetProperty="(UIElement.Visibility)">

<DiscreteObjectKeyFrame KeyTime="00:00:00.0250000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Visible</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

<DiscreteObjectKeyFrame KeyTime="00:00:00.0500000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Collapsed</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

</ObjectAnimationUsingKeyFrames>

<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="canev2" Storyboard.TargetProperty="(UIElement.Visibility)">

<DiscreteObjectKeyFrame KeyTime="00:00:00.0500000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Visible</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

<DiscreteObjectKeyFrame KeyTime="00:00:00.0750000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Collapsed</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

</ObjectAnimationUsingKeyFrames>

<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="canev3" Storyboard.TargetProperty="(UIElement.Visibility)">

<DiscreteObjectKeyFrame KeyTime="00:00:00.0750000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Visible</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

<DiscreteObjectKeyFrame KeyTime="00:00:00.1000000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Collapsed</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

</ObjectAnimationUsingKeyFrames>

<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="canev4" Storyboard.TargetProperty="(UIElement.Visibility)">

<DiscreteObjectKeyFrame KeyTime="00:00:00.1000000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Visible</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

<DiscreteObjectKeyFrame KeyTime="00:00:00.1250000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Collapsed</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

</ObjectAnimationUsingKeyFrames>

<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="canev5" Storyboard.TargetProperty="(UIElement.Visibility)">

<DiscreteObjectKeyFrame KeyTime="00:00:00.1250000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Visible</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

<DiscreteObjectKeyFrame KeyTime="00:00:00.1500000">

<DiscreteObjectKeyFrame.Value>

<vsm:Visibility>Collapsed</vsm:Visibility>

</DiscreteObjectKeyFrame.Value>

</DiscreteObjectKeyFrame>

</ObjectAnimationUsingKeyFrames>

</Storyboard>

</vsm:VisualState>

 

Allen Chen – MSFT
Allen Ch...

Star

Star

13862 points

1,803 Posts

Answered Question

Re: Problem in trying to set up a sprite animation

Hi:

  You may hit a known issue. We're now investigating it.

http://silverlight.net/forums/t/18263.aspx

Regards

Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities