The word <em>attack</em> can be used either as a verb or a noun. When it's a verb, it refers to the action of attempting to cause damage or death to something or someone, and when it is a noun, it refers to an aggressive and violent act or attempt against someone or something.
In the sentence, <em>attack</em> is used as a noun because it is placed after an article: <em>the </em>(Verbs are not placed after an article). Besides, if we replace the word <em>attack</em> for its definition, it makes sense: <em>(...) as the blue alligator closed in for the violent attempt against the purple flamingo. </em>