Flash Action Script Error Repository

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

Archive for October, 2009

The type selector ” was not processed, because the type was not used in the application.

The type selector ‘Alert’ was not processed, because the type was not used in the application.

Reason
The compiler is telling you that it can’t find a case where the CSS that you are including inline or in a stylesheet is being used in the application. This is regardless if it will be used at another time. If it’s not being used in the application it’s not included at run time.

To remove this warning add the following line to the command line arguments:

-show-unused-type-selector-warnings=false

Note that “unused’ type selectors aren’t included to keep the file size down.

If you want to include every CSS type selector whether it’s being used or not add the following line to the command line arguments:

-keep-all-type-selectors=true

To change command line arguments in Flash Builder navigate to Properties > Flex Compiler > Additional Compiler Arguments.

No comments

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>

No comments

ArgumentError: newElement not of a type that this can be parent of

ArgumentError: NewElement not of a type that this can be parent of

Reason
TextFlow markup is malformed. It does not allow certain elements to contain other elements. For example, a paragraph cannot contain another paragraph. It also occurs when you have line breaks in your markup tags, "\n\t\t\t\t".

Incorrect:

XML:
  1. <s:RichEditableText x="93" y="22">
  2.         <s:content>
  3.             <s:TextFlow xmlns="http://ns.adobe.com/textLayout/2008">

Notice the line break after the content tag.

Correct:

XML:
  1. <s:RichEditableText x="93" y="22">
  2.         <s:content><s:TextFlow xmlns="http://ns.adobe.com/textLayout/2008">

Read more here...

No comments

Error: Unknown element http://ns.adobe.com/textLayout/2008::

Error: Unknown element http://ns.adobe.com/textLayout/2008::

Reason
The element in the markup is not found. For example, the "em" tag is not supported. So when it is encountered an error with the message "Unknown element http://ns.adobe.com/textLayout/2008::em" is thrown. Notice the "em" is tagged at the end of the error message. It may be possible to create an em element. Not sure. Read more here...

Incorrect Code:

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

XML:
  1. <s:RichEditableText width="100%" y="52" styleName="postDescription" text="Description area"
  2.     editable="false" lineBreak="toFit" textFlow="{TextFlowUtil.importFromString(XML(myString))}">
  3. </s:RichEditableText>

Correct Code:

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

No comments

ArgumentError: newElement not of a type that this can be parent of

ArgumentError: newElement not of a type that this can be parent of

Reason

Incorrect Code:

XML:
  1. <s:RichEditableText x="11" y="35" text="Just text
" width="352">
  2.         <s:TextFlow color="0x555555">
  3.             <s:p>
  4.                 <s:span fontWeight="bold">Just text</s:span>
  5.                 <s:br />
  6.                 <s:a href="http://twitter.com/">Click here</s:a>
  7.                 <s:p>
  8.                     <s:img source="images/node_loader1.swf"></s:img>
  9.                 </s:p>
  10.             </s:p>
  11.         </s:TextFlow>
  12.  
  13.     </s:RichEditableText>

No comments

Unable to generate initialization code within Repeater, due to id or data binding on a component that is not a visual child.

Unable to generate initialization code within Repeater, due to id or data binding on a component that is not a visual child.

Reason
Unknown

Incorrect Code:

XML:
  1. <s:RichEditableText width="100%" y="52" styleName="postDescription" text="Description area" editable="false">
  2.     <s:TextFlow xmlns="http://ns.adobe.com/textLayout/2008">{TLFFormatter.format(XML(postsRepeater.currentItem).content)}</s:TextFlow>
  3. </s:RichEditableText>

No comments

TypeError: Bad element of type flashx.textLayout.elements::TextFlow passed to FlowGroupElement.mxmlChildren

TypeError: Bad element of type flashx.textLayout.elements::TextFlow passed to FlowGroupElement.mxmlChildren
Reason
I think because I passed in an XMLList (converted by the Flex framework) instead of a format it was looking for. It can accept arrays, strings, etc.

Incorrect Code:

XML:
  1. <s:RichEditableText width="100%" y="52" styleName="postDescription" text="Description editable="false" content="{XML(postsRepeater.currentItem).content}"/>

Correct Code:

XML:
  1. <s:RichEditableText width="100%" y="52" styleName="postDescription" text="Description editable="false" content="{String(XML(postsRepeater.currentItem).content)}"/>

No comments