Neil Patrick Harris came out publicly because it felt ''disrespectful'' to David Burtka not to speak about his sexuality.

The 'How I Met Your Mother' actor - who has eight-year-old twins Gideon and Harper with his spouse - insists the only reason he never spoke directly about the subject until 2006 was because he didn't want to be opened up to ''potential bias'' but he eventually realised that simply staying quiet wasn't enough as he wanted to be able to attend events with his partner.

He said: ''I wasn't trying not to reveal myself. I just thought, as an actor, you need to have the opportunity to be seen as a bunch of different things without a potential bias from someone else.

''I do magic, and magicians as well don't want anyone to know anything about them. And so I didn't deny anything at all.

''But then I was dating my now-husband and I realised it was most disrespectful to him to go in the car to an opening of a movie, and then I would go down the carpet and he would go with our publicist, behind where the camera guys were, and we'd meet up at the end. And it just felt disrespectful.

''All that said, though, I don't think that anyone should be told when anything is supposed to happen.''

And when the 45-year-old star did confirm he is gay, he felt ''a little bit concerned'' that it would have an impact on his career - so was pleasantly surprised to find he felt more ''inclusive'' and less ''marginalised'' than ever before.

He told Entertainment Weekly magazine: ''I was a little bit concerned because I was on How I Met Your Mother where I was playing a very, very straight, alpha male, best friend kind of guy. I was concerned that the writers would feel like they needed to write jokes for me differently. And that wasn't the case -- I just kept playing it. And I'm happy.

''My job as an actor is to play as many different types of roles as I can. And so, I'm just trying to be turning on as many different demographics as possible.

''For me, when that happened and I was able to stand taller and be who I actually was, then I could flirt with guys, I could flirt with girls, and I could flirt with older people and young. It almost made it more inclusive, as opposed to more marginalised. I like flirting.''