Tone generation in Flex