Archive for the 'Compiler' Category
Invalid component name ‘default’: component name must be legal ActionScript class name.
Invalid component name ‘default’: component name must be legal ActionScript class name. default.css
You cannot name a class or css file a reserved keyword such as, “if”, “else”, “switch”, “default”, etc
Incorrect filename:
default.css
Correct filename
styles.css
” declaration must be contained within the tag, since it is not assignable to the default property’s element type ‘mx.core.IVisualElement’.
” declaration must be contained within the <Declarations> tag, since it is not assignable to the default property’s element type ‘mx.core.IVisualElement’.
This is interesting! I pasted code in an ichat window then copied it out and pasted it back into the MXML application file. After that I started getting the error mentioned here. It turns out there are hidden invisible characters that are incompatible with the compiler.
So to fix this problem I had to erase the white space near where the error was. This fixed the problem. NOTE: It may be the error is on the line above or line below where it is being reported.
No commentsThe dependency spark.components.Button from /Applications/Adobe Flash Builder 4/sdks/4.0.0/frameworks/libs/spark.swc has a minimum supported version of 4.0.0, which is higher than the compatibility version, 3.0.0.
The dependency spark.components.Button from /Applications/Adobe Flash Builder 4/sdks/4.0.0/frameworks/libs/spark.swc has a minimum supported version of 4.0.0, which is higher than the compatibility version, 3.0.0.
Problem
The “Use Flex 3 Compatibility mode” flag is checked in the Flash Builder compiler settings and conflicts with the Flex SDK version you have chosen. Read more here… http://opensource.adobe.com/wiki/display/flexsdk/Compatibility+Mode+SWC+Policy+(Mini+Specification)
Solution
Turn off this option in the Flex Compiler settings by unchecking this box in your project. Easy…
Initializer for ‘dataProvider’: values of type mx.collections.IList cannot be represented in text.
Initializer for 'dataProvider': values of type mx.collections.IList cannot be represented in text.
Problem
The problem is we are not enclosing the reference to array collection with curly braces. The list component thinks that we are passing a string. So changing from "myData" to "{myData}".
Incorrect code:
-
<fx:Declarations>
-
-
<s:ArrayCollection id="myData">
-
<s:source>
-
<fx:Object label="Engineering" data="ENG"/>
-
<fx:Object label="Product Management" data="PM"/>
-
<fx:Object label="Marketing" data="MKT"/>
-
</s:source>
-
</s:ArrayCollection>
-
</fx:Declarations>
-
-
<s:List dataProvider="myData" x="10" y="10" width="575" height="297" skinClass="ActivityStreamSkin"></s:List>
Solution
-
<s:List dataProvider="{myData}" x="10" y="10" width="575" height="297" skinClass="ActivityStreamSkin"></s:List>
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 commentsError at line 29 in your MXML document
Error at line 29 in your MXML document
This means that the MXML document is not valid XML. It could be numerous things.
The easiest way to fix this is to "Undo" the last few changes you made. This should get you back to a valid XML document.
Unfortunately there is a bug when renaming links in Flash Builder that can cause this error when the document is actually valid. The fix is to close the MXML document and then reopen it.
No commentsThe value of attribute “htmlText” must not contain the ‘<’ character.
The value of attribute "htmlText" must not contain the '<' character.
The problem code:
-
<mx:Text id="postFooter1" width="100%" y="0"
-
htmlText="Posted in <a href='event:{postsRepeater.currentItem.categories.category.@name}'>{postsRepeater.currentItem.categories.category.@name}</a>" />
Because of the less than sigh, "<" the error was appearing. The solution is to encode the less than sign like so:
-
<mx:Text id="postFooter1" width="100%" y="0"
-
htmlText="Posted in <a href='event:{postsRepeater.currentItem.categories.category.@name}'>{postsRepeater.currentItem.categories.category.@name}</a>" />
The entity “raquo” was referenced, but not declared.
The entity "raquo" was referenced, but not declared.
The compiler does not like the entity, "raquo;" as shown in the htmlText attribute:
-
<controls:TextAutoSize id="postFooter1" width="100%" y="55"
-
htmlText="Comments »" textAlign="center"/>
No solution is available at this time...
2 commentsData binding expressions not supported with attributes processed at compile time.
Data binding expressions not supported with attributes processed at compile time.
This error occurred when I tried to bind the source property of a Style.
-
<mx:Style source="{style}" />
The prefix “mx” for element “mx:VBox” is not bound.
The prefix "mx" for element "mx:VBox" is not bound.
Explanation:
The prefix "mx" is not bound to any namespace definition. In my case the namespace definition was missing in my MXML component.
Incorrect
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx:VBox>
-
-
</mx:VBox>
Correct
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
-
-
</mx:VBox>
Event type ‘com.flexcapacitor.events:StateHandler’ is unavailable.
Event type 'com.flexcapacitor.events:StateHandler' is unavailable.
Here is the line causing the error:
-
<managers:StateHandler state="{productsState1}" callFunction="Alert.show(ObjectUtil.toString(event))"/>
If I remove the callFunction attribute the error goes away. So what's the issue?
In my StateHandler class I have this metadata:
[Event(name="callFunction", type="com.flexcapacitor.events.StateHandler")]
The problem is the class is defined as StateHandlerEvent not StateHandler. So I change it StateHandlerEvent and it works:
[Event(name="callFunction", type="com.flexcapacitor.events.StateHandlerEvent")]
From the documentation
If you do not identify an event with the [Event] metadata tag, the compiler generates an error if you try to use the event name in MXML. The metadata for events is inherited from the superclass, however, so you do not need to tag events that are already defined with the [Event] metadata tag in the superclass.
No comments1046: Type was not found or was not a compile-time constant: ContentElement. TextLayoutFramework
Error Message
1046: Type was not found or was not a compile-time constant: ContentElement. TextLayoutFramework
[etc] ElementFormat. FontMetrics. TextElement. TextLine. Vector.
Cause
In this case the class was not found because I was specifying Flash Player 9 when the class was in Flash Player 10.
Solution
When I went into the Project Properties > Flex Compiler and changed the required version to 10.0.0 the errors went away.
Please note this is a case post. There are additional posts on this error.
2 comments