# Detect when timeline finished

**URL:** <https://forums.fusetools.com/t/detect-when-timeline-finished/5485>\
**Category:** How-to Discussions\
**Created:** [November 6, 2016, 8:45pm UTC](https://forums.fusetools.com/t/detect-when-timeline-finished/5485 "2016-11-06T20:45:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ted.ekeroth](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@ted.ekeroth](https://forums.fusetools.com/u/ted.ekeroth)\
**Post date:** [November 6, 2016, 8:45pm UTC](https://forums.fusetools.com/t/detect-when-timeline-finished/5485/1 "2016-11-06T20:45:10Z")

</div>

Hey,  
how can I detect when an animation is finished, using a timeline? I was thinking about the WhileXXXX tags, or perhaps the ux:ProgressChanged event, but Im not sure how to swing it.

```auto
<Page ux:Class="SplashScreen">

	<StackPanel ux:Name="sp1" X="50%" Y="25%" Anchor="50%,50%" Width="200">
    	<AlfaPro ux:Name="alfaProIcon" />
    	<TextView ux:Name="tvWelcome" Value="Welcome to Test" Alignment="Center" Opacity="0" TextColor="#fff" />
    	
    	<MyButton ux:Name="btnProceed" Text="123S" />
    	
	</StackPanel>

 	<Timeline ux:Name="timeline">
 		<Move Target="sp1" Y="-400" Duration="0" />
 		<Change Target="tvWelcome.Opacity" Delay="1.0">
 			<Keyframe Value="1" Time="0.5" />
 			<Keyframe Value="1" TimeDelta="1" />
 			<Keyframe Value="0" TimeDelta="0.5" />
 			<Keyframe Value="1" TimeDelta="1" />
 			<Keyframe Value="1" TimeDelta="1" />
 			<Keyframe Value="0" TimeDelta="0.5" />
 		</Change>
 		<Set tvWelcome.Value="Let's start!" Delay="3.0" />
    	<Move Target="sp1" Y="400" Duration="1" Delay="0.1" Easing="BounceOut" />

    </Timeline>

	<WhileActive>
	    <Change timeline.TargetProgress="1" />
    </WhileActive >

</Page>

```

---

<div class="post-metadata">

**Author:** ![Kristian\_Hasselknipp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/kristian_hasselknipp/32/549_2.png) [@Kristian\_Hasselknipp](https://forums.fusetools.com/u/Kristian_Hasselknipp)\
**Post date:** [November 9, 2016, 5:07pm UTC](https://forums.fusetools.com/t/detect-when-timeline-finished/5485/2 "2016-11-09T17:07:26Z")

</div>

Hi!

The easiest way is just to add an action to the end of your timeline:

```auto
<Timeline>
    <Move Duration="0.5" ...
    <Change Duration="1" ...
    <Callback Handler="{callToJSWhenTimelineIsDone}" Duration="1" />
</Timeline>

```

i use Duration=“1” on the callback here because that is the same as the length of the Timeline.
