# If after x seconds gotoandplay

**URL:** https://forum.kirupa.com/t/if-after-x-seconds-gotoandplay/299076
**Category:** Uncategorized
**Created:** [October 29, 2009, 12:34pm UTC](https://forum.kirupa.com/t/if-after-x-seconds-gotoandplay/299076 "2009-10-29T12:34:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![8bitboy](https://avatars.discourse-cdn.com/v4/letter/8/c6cbf5/32.png) [@8bitboy](https://forum.kirupa.com/u/8bitboy)
#### Post date: [October 29, 2009, 12:34pm UTC](https://forum.kirupa.com/t/if-after-x-seconds-gotoandplay/299076/1 "2009-10-29T12:34:02Z")

</div>

I have a video player and I want to read the duration counter so that after say 5 seconds the video fades in some movie clips pauses for a few seconds then fades the movieclips out.

heres what i have so far as a test I have used gotoand play . If I insert this the movie does not reach 5 seconds but goes to frame 8 straight away. If I try a \< or == nothing happens ?

// Get video duration  
ns.onMetaData = function(obj) {  
duration = obj[“duration”];  
var minutes2:Number = Math.round(duration/60);  
var seconds2 = Math.round(duration%60);  
if (seconds2\<10) {  
seconds2 = “0”+seconds2;

```
	}
	if (seconds2&lt;5) {

```

gotoAndPlay(8);

}

```
	durationDisplay = minutes2+":"+seconds2;
};

```

};
