Flash Action Script Error Repository

A library of solutions to Actionscript, Flash, Flex and AIR

Error: Unexpected element spanwithin a span

Error: Unexpected element spanwithin a span (sic)

Reason
Span's cannot contain other spans. Spans can only contain text. More information...

Spans should be closed off before starting a new one.

Original Code:

XML:
  1. public var myString:XML = <div><img source="images/spinning_loader1.swf"/><span fontStyle="italic"><span fontWeight="bold">Flex is a highly productive, free open source framework for building and maintaining expressive web applications...</span></span><br/></div>;

Correct code:

XML:
  1. <flow:span>Some text that is </flow:span><flow:span fontWeight="bold">bold and </flow:span><flow:span fontWeight="bold" textDecoration="underline">bold and underlined</flow:span>

Please post your comments to help future visitors.

No comments yet. Be the first.

Leave a reply

Wrap MXML and ActionScript in [xml] [/xml] and [as] [/as] tags respectively