Apache flex 火花标签问题
在下面的代码中,我无法解释为什么会出现这样的错误:无法明确地解析多名称引用。组件:标记它以前工作过,现在我只收到错误消息Apache flex 火花标签问题,apache-flex,label,flex-spark,Apache Flex,Label,Flex Spark,在下面的代码中,我无法解释为什么会出现这样的错误:无法明确地解析多名称引用。组件:标记它以前工作过,现在我只收到错误消息 <?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="800" height="523" maxWidth="800" maxHeight="523" initialize="httpService.send()" showStatusBar="false" backgroundColor="white" backgroundAlpha="1">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Label;
import mx.rpc.events.ResultEvent;
public var returnData:ArrayCollection;
protected function httpService_handler(event:ResultEvent):void{
returnData = event.result.people.person;
for( var i:int = 0; i < 5; i++){
var lbl:Label = new Label();
lbl.text = "News Item " + i;
//newsHGroup.addElement(lbl);
}
}
]]>
</fx:Script>
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
</fx:Style>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:HTTPService id="httpService" url="http://pipingautos.com/~nibbrco/glen-dev-folder/air/school-catch-up/test.php" result="httpService_handler(event)" />
</fx:Declarations>
<s:BorderContainer borderVisible="false" mouseDown="nativeWindow.startMove();" skinClass="MainStyle" width="800" height="523" id="container">
<s:Group id="newsSlider" left="435" top="120" height="100" width="340">
<s:Rect width="100%" height="100%" id="backRect">
<s:fill><s:SolidColor color="0xc7d1e5" alpha="0.5" /></s:fill>
</s:Rect>
<s:HGroup>
<s:Label text="testing" />
</s:HGroup>
</s:Group>
</s:BorderContainer>
</s:WindowedApplication>
你跟我混在一起了。AS代码中的标签是mx one,请参见import语句,但mxml代码中的标签是Spark版本,请参见“s”命名空间。
它们实际上是某种相同的成分;前者是Flex 4的等价物,后者是Flex 3组件。
由于您似乎正在构建Flex4应用程序,所以请坚持使用Spark版本。只需将mx“import”语句替换为spark类路径:
import spark.components.Label
你跟我混在一起了。AS代码中的标签是mx one,请参见import语句,但mxml代码中的标签是Spark版本,请参见“s”命名空间。
它们实际上是某种相同的成分;前者是Flex 4的等价物,后者是Flex 3组件。
由于您似乎正在构建Flex4应用程序,所以请坚持使用Spark版本。只需将mx“import”语句替换为spark类路径:
import spark.components.Label
请注意,如果要显示人员列表,最好使用列表或数据组,而不是手动添加标签。请注意,如果要显示人员列表,最好使用列表或数据组,而不是手动添加标签。