flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Devsena (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-35203) XML() class is broken javascript mode in 0.8 dev
Date Mon, 19 Dec 2016 10:17:59 GMT

    [ https://issues.apache.org/jira/browse/FLEX-35203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15760783#comment-15760783
] 

Devsena commented on FLEX-35203:
--------------------------------

It seems like generating any XML object throws error in HTML run with FlexJS nightly build
(in my tests). I have slightly different codes than what others reported, but idea is same.
I tried to generate an XML object with supposed to be valid data (not by an empty XML() constructor),
but I reported by the same error in Windows Firefox. 
{code}
<?xml version="1.0" encoding="utf-8"?>
<js:View xmlns:fx="http://ns.adobe.com/mxml/2009"
		 xmlns:js="library://ns.apache.org/flexjs/basic" initComplete="DataAgent()"
		 width="100%" height="100%">
	<fx:Script>
		<![CDATA[
			import org.apache.flex.html.Alert;
			import org.apache.flex.net.HTTPService;
			
			private var httpS:HTTPService;
			
			public function DataAgent():void
			{
				httpS = new HTTPService();
				httpS.method = "get";
				httpS.url = --censored--;
				httpS.addEventListener("complete", onCompleteEvent);
				httpS.addEventListener("ioError", onIOError);
				
				httpS.send();
			} 
			
			private function onCompleteEvent(event:Event):void
			{
				var xml:XML = new XML(event.target.data);
				txtOutput.text = xml.toXMLString();
			}
			
			private function onIOError(event:Event):void
			{
				Alert.show(event.toString(), this);
			}
			
		]]>
	</fx:Script>
	
	<js:beads>
		<!-- Place custom beads here -->
	</js:beads>
	
	<js:Container width="100%" height="100%" >
		<js:TextArea id="txtOutput" 
					 width="100%" height="100%"/>
	</js:Container>
</js:View>
{code}
When I ran this as HTML, I had this in Firefox 'web console' - the former error I can understand
because of sandbox but the latter seems caused by _onCompleteEvent_ method:
!XMLError.png!

> XML() class is broken javascript mode in 0.8 dev
> ------------------------------------------------
>
>                 Key: FLEX-35203
>                 URL: https://issues.apache.org/jira/browse/FLEX-35203
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: FlexJS
>    Affects Versions: Apache FlexJS 0.7.0, Apache FlexJS 0.8.0
>            Reporter: Pan Li
>            Assignee: Alex Harui
>             Fix For: Apache FlexJS 0.8.0
>
>         Attachments: Test1.js, XMLError.png
>
>
> {code}
> 	<fx:Script>
> 		<![CDATA[
> 		
> 		var foo : XML = new XML();
> 			
> 		]]>
> 	</fx:Script>
> {code}
> above code result in runtime javascript error
>  Uncaught ReferenceError: XML is not defined
> the same code works in swf mode



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message