~ubuntu-branches/ubuntu/karmic/moon/karmic

« back to all changes in this revision

Viewing changes to test/xaml/assorted/test-keyframe-keytime.html

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-14 12:01:08 UTC
  • Revision ID: james.westby@ubuntu.com-20090214120108-06539vb25vhbd8bn
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 
2
<head>
 
3
<title>Accessing keyframe keytime</title>
 
4
<meta></meta>
 
5
</head>
 
6
<body>
 
7
 
 
8
<script type="text/javascript">
 
9
function OnMouseEnter (sender, eventArgs)
 
10
{
 
11
        keyframe = sender.findName ("one");
 
12
        console.log ("Seconds: %d", keyframe.KeyTime.Seconds);
 
13
        keyframe.KeyTime.Seconds = 3.1;
 
14
        sender.findName ("sb").Begin ();
 
15
}
 
16
</script>
 
17
 
 
18
<object type="application/x-silverlight" data="data:," id="slControl" width="300" height="400">
 
19
<param name="background" value="#FFFFFF"/>
 
20
<param name="source" value="#xamlContent"/>
 
21
</object>
 
22
 
 
23
<script type="text/xaml" id="xamlContent">
 
24
<?xml version="1.0"?>
 
25
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 
26
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
 
27
 
 
28
        <Rectangle x:Name="target" Fill="Blue" Canvas.Top="10" Canvas.Left="10" MouseEnter="OnMouseEnter" Width="100" Height="100" />
 
29
 
 
30
        <Canvas.Resources>
 
31
                <Storyboard x:Name="sb">
 
32
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="target" Storyboard.TargetProperty="(Canvas.Left)">
 
33
                                <DiscreteDoubleKeyFrame x:Name="zero" KeyTime="00:00:00" Value="10.0"/>
 
34
                                <DiscreteDoubleKeyFrame x:Name="one" KeyTime="00:00:02" Value="100.0"/>
 
35
                        </DoubleAnimationUsingKeyFrames>
 
36
                </Storyboard>
 
37
        </Canvas.Resources>
 
38
        </Canvas>
 
39
</script>
 
40
 
 
41
</body>
 
42
</html>