How does MXML and Actionscript 3 relate?

Hi all,

I have been using Flex Builder for a while now, infact since i started coding in AS3 Projects.

One of the fundamental issues i have from experience of trying flex, is i dont see how MXML tags and AS3 is related.

Can someone try to explain to me from an Actionscript perspective?

If i create a class which extends sprite and draws a random pattern, then how can flex use that class? Does it automatically become <PixelBackground /> ?