<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: Max Crashes when using js and xml</title>
		<atom:link href="http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 21:03:24 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-50065</guid>
					<title><![CDATA[Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-50065</link>
					<pubDate>Thu, 29 Apr 2010 02:46:35 +0000</pubDate>
					<dc:creator>george.profenza</dc:creator>

					<description>
						<![CDATA[
						<p>Hello,</p>
<p>I have noticed that max&#8217;s javascript interpreter has E4X support. The problem is it seems to be limited. I don&#8217;t know if the limitation comes the size of the js file or it&#8217;s something else. I&#8217;m completely lost.</p>
<p>Here is a basic path to illustrate the idea:</p>
<p>
<div><span id="toggle50065-0" class="patchtoggle" onmousedown="toggleMaxPatch('post50065-0', 'er50065-0');">&#8211; Pasted Max <span id="maxversion50065-0"></span> Patch, click to <span id="er50065-0">expand</span>. &#8211;</span> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  width="110" height="14" class="clippy" ><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param NAME="FlashVars" value="copied=copied!&#038;copyto=copy to clipboard"/><param name="bgcolor" value="#FFFFFF"/><param name="wmode" value="opaque"/><embed src="/wp-content/plugins/bbpress-copy-compressed/clippy.swf"  width="110" height="14"   name="clippy"  quality="high"  allowScriptAccess="always"  type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="text=----------begin_max5_patcher----------%0A264.3ocmREsaCBCC74juhH%2BLqB5VUa2a66XpZJ.YTWERPDiFaU8eefAVgJso%0Ap8xIky14tyImkBH02ZBf5Y0qJg3rTHXpdBw3YATpayr5.2Fj1Pj2AQCkbMkn%0AyZHtVxUReCcK6.E8YkYPNHU6J.0gwxUZJ6H5Jdq1jQCcrY8p3H05mXLdB%2BYB%0ALmMjO8zCI6gdtKRYODcmQwY9na3onPlVVW3TPUX8oZaX0ov%2BHnu6cjSWxwDd%0AoF0V32VA2Q72rsG293eF%2BcvLsC3W78mzM%2BrsBOHXQ2su2rz87KWUAeSc1jQG%0AWxQpq5maBD5zD18aXVS6VzzQLO2v0iGYJw7JO5nQSnNrvhxKxugGUmo.%0A-----------end_max5_patcher-----------&#038;copied=copied!&#038;;copyto=copy to clipboard"  bgcolor="#ffffff"  wmode="opaque" /> </object></div>
<div id="post50065-0" style="display:none;visibility:hidden;" >
<div class="patchtoggleInfo"><small>Copy <b>all</b> of the following text.Then, in Max, select <em>New From Clipboard</em>.</small></div>
<div class="patchtogglediv">
<pre><code id="pastedcode50065-0">----------begin_max5_patcher----------
264.3ocmREsaCBCC74juhH+LqB5VUa2a66XpZJ.YTWERPDiFaU8eefAVgJso
p8xIky14tyImkBH02ZBf5Y0qJg3rTHXpdBw3YATpayr5.2Fj1Pj2AQCkbMkn
yZHtVxUReCcK6.E8YkYPNHU6J.0gwxUZJ6H5Jdq1jQCcrY8p3H05mXLdB+YB
LmMjO8zCI6gdtKRYODcmQwY9na3onPlVVW3TPUX8oZaX0ov+Hnu6cjSWxwDd
oF0V32VA2Q72rsG293eF+cvLsC3W78mzM+rsBOHXQ2su2rz87KWUAeSc1jQG
WxQpq5maBD5zD18aXVS6VzzQLO2v0iGYJw7JO5nQSnNrvhxKxugGUmo.
-----------end_max5_patcher-----------</code></pre></div>
</div>
</p><p>contents of globals.js used in the patcher:</p>
<p>inlets = 1;<br />
outlets = 0;<br />
autowatch = 1;</p>
<p>var g = new Global(&#8220;g_xml&#8221;);<br />
g.xml = </p>
<p>function bang(){<br />
    post(g.xml.toString());<br />
}</p>
<p>function create() {}</p>
<p>A friend is trying to use xml for it&#8217;s tree structure to play some videos non-linearly. Here is an example of a basic function that also uses E4X:<br />
function get_video(){<br />
    var path = xml.section.(@name == arguments[0]).video.(@key ==<br />
arguments[1]).@path.toString();<br />
    section = xml.section.(@name == arguments[0]).video.(@key ==<br />
arguments[1]).@section.toString();<br />
    //post(&#39;your next section is &#39; + section);<br />
    outlet(0,&#8221;path&#8221;,path);<br />
    outlet(0,&#8221;section&#8221;,section);<br />
}</p>
<p>arguments[0] is a string, the name of a section and arguments[1] is a key.</p>
<p>The HUGE problem is once I bang that globals.js object, Max crashes. That happens all the time, tested on 2 different machines. If I leave just half of the section nodes in, Max doesn&#8217;t crash.</p>
<p>Does anyone have an idea why that happens and what can I do go around the issue ?</p>
<p>Thank,<br />
George</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179709</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179709</link>
					<pubDate>Thu, 29 Apr 2010 10:47:41 +0000</pubDate>
					<dc:creator>Jesse</dc:creator>

					<description>
						<![CDATA[
						<p>I think the problem is in your XML.  Starting with &#8220;checkpoint_7a&#8221; you are using a different formatting.</p>
<p>
<section name="...">
&#8230;</section></p>
<section ="..."></section>


<p>instead of:</p>
<p>
<section name="...">
&#8230;<br />
</section></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179710</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179710</link>
					<pubDate>Thu, 29 Apr 2010 11:43:19 +0000</pubDate>
					<dc:creator>george.profenza</dc:creator>

					<description>
						<![CDATA[
						<p>I wished you were right, it would&#8217;ve been so simple.</p>
<p>I formatted the js file using TextMate, no luck.</p>
<p>The crash is pretty consistent.<br />
If I use this much nodes:</p>
<p>&#8216;<br />
xml = <tour></tour></p>
<section name="checkpoint_1">
			<video path="C1Enter.mov" key="f" section="checkpoint_1"></video><br />
			<video path="C1Left.mov" key="l" section="checkpoint_10a"></video><br />
			<video path="C1Right.mov" key="r" section="checkpoint_2a"></video><br />
		</section>
<p></p>
<section name="checkpoint_2a">
			<video path="C2Enter.mov" key="r" section="checkpoint_2a"></video><br />
			<video path="C2Back.mov" key="b" section="checkpoint_1"></video><br />
			<video path="C2Forward.mov" key="f" section="checkpoint_3a"></video><br />
		</section>
<p></p>
<section name="checkpoint_2b">
			<video path="C2Enter.mov" key="l" section="checkpoint_2a"></video><br />
			<video path="C2Back.mov" key="f" section="checkpoint_1b"></video><br />
			<video path="C2Forward.mov" key="b" section="checkpoint_3a"></video><br />
		</section>
<p></p>
<section name="checkpoint_3a">
			<video path="C3Enter.mov" key="r" section="checkpoint_3a"></video><br />
			<video path="C3Back.mov" key="b" section="checkpoint_2b"></video><br />
			<video path="C3Forward.mov" key="f" section="checkpoint_4a"></video><br />
		</section>
<p></p>
<section name="checkpoint_3b">
			<video path="C3Enter.mov" key="l" section="checkpoint_3a"></video><br />
			<video path="C3Back.mov" key="f" section="checkpoint_2b"></video><br />
			<video path="C3Forward.mov" key="b" section="checkpoint_3a"></video><br />
		</section>
<p></p>
<section name="checkpoint_4a">
			<video path="C4Enter.mov" key="r" section="checkpoint_4a"></video><br />
			<video path="C4Back.mov" key="b" section="checkpoint_3b"></video><br />
			<video path="C4Forward.mov" key="f" section="checkpoint_5a"></video><br />
		</section>
<p></p>
<section name="checkpoint_4b">
			<video path="C4Enter.mov" key="l" section="checkpoint_4a"></video><br />
			<video path="C4Back.mov" key="f" section="checkpoint_3b"></video><br />
			<video path="C4Forward.mov" key="b" section="checkpoint_5a"></video><br />
		</section>
<p></p>
<section name="checkpoint_5a">
			<video path="C4Enter.mov" key="l" section="checkpoint_4a"></video><br />
			<video path="C4Back.mov" key="f" section="checkpoint_3b"></video><br />
			<video path="C4Forward.mov" key="b" section="checkpoint_5a"></video><br />
		</section>
<p>
	<br />
&#8216;<br />
It&#8217;s all fine.</p>
<p>If I add another node, like so:<br />
&#8216;<br />
xml = <tour></tour></p>
<section name="checkpoint_1">
			<video path="C1Enter.mov" key="f" section="checkpoint_1"></video><br />
			<video path="C1Left.mov" key="l" section="checkpoint_10a"></video><br />
			<video path="C1Right.mov" key="r" section="checkpoint_2a"></video><br />
		</section>
<p></p>
<section name="checkpoint_2a">
			<video path="C2Enter.mov" key="r" section="checkpoint_2a"></video><br />
			<video path="C2Back.mov" key="b" section="checkpoint_1"></video><br />
			<video path="C2Forward.mov" key="f" section="checkpoint_3a"></video><br />
		</section>
<p></p>
<section name="checkpoint_2b">
			<video path="C2Enter.mov" key="l" section="checkpoint_2a"></video><br />
			<video path="C2Back.mov" key="f" section="checkpoint_1b"></video><br />
			<video path="C2Forward.mov" key="b" section="checkpoint_3a"></video><br />
		</section>
<p></p>
<section name="checkpoint_3a">
			<video path="C3Enter.mov" key="r" section="checkpoint_3a"></video><br />
			<video path="C3Back.mov" key="b" section="checkpoint_2b"></video><br />
			<video path="C3Forward.mov" key="f" section="checkpoint_4a"></video><br />
		</section>
<p></p>
<section name="checkpoint_3b">
			<video path="C3Enter.mov" key="l" section="checkpoint_3a"></video><br />
			<video path="C3Back.mov" key="f" section="checkpoint_2b"></video><br />
			<video path="C3Forward.mov" key="b" section="checkpoint_3a"></video><br />
		</section>
<p></p>
<section name="checkpoint_4a">
			<video path="C4Enter.mov" key="r" section="checkpoint_4a"></video><br />
			<video path="C4Back.mov" key="b" section="checkpoint_3b"></video><br />
			<video path="C4Forward.mov" key="f" section="checkpoint_5a"></video><br />
		</section>
<p></p>
<section name="checkpoint_4b">
			<video path="C4Enter.mov" key="l" section="checkpoint_4a"></video><br />
			<video path="C4Back.mov" key="f" section="checkpoint_3b"></video><br />
			<video path="C4Forward.mov" key="b" section="checkpoint_5a"></video><br />
		</section>
<p></p>
<section name="checkpoint_5a">
			<video path="C4Enter.mov" key="l" section="checkpoint_4a"></video><br />
			<video path="C4Back.mov" key="f" section="checkpoint_3b"></video><br />
			<video path="C4Forward.mov" key="b" section="checkpoint_5a"></video><br />
		</section>
<p></p>
<section name="checkpoint_5b">
			<video path="C4Enter.mov" key="l" section="checkpoint_4a"></video><br />
			<video path="C4Back.mov" key="f" section="checkpoint_3b"></video><br />
			<video path="C4Forward.mov" key="b" section="checkpoint_5a"></video><br />
		</section>
<p>
	<br />
&#8216;<br />
Max crashes :(</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179711</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179711</link>
					<pubDate>Thu, 29 Apr 2010 12:39:20 +0000</pubDate>
					<dc:creator>Jesse</dc:creator>

					<description>
						<![CDATA[
						<p>Try reformatting &#8220;checkpoint_5a&#8221; to conform to the pattern in the previous entries:</p>
<p>
<section name="checkpoint_5a">
<video path="C4Enter.mov" key="r" section="checkpoint_4a"></video><br />
<video path="C4Back.mov" key="l" section="checkpoint_3b"></video><br />
<video path="C4Forward.mov" key="f" section="checkpoint_5a"></video><br />
</section>
</p>
<p>?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179712</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179712</link>
					<pubDate>Thu, 29 Apr 2010 13:57:42 +0000</pubDate>
					<dc:creator>george.profenza</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks for the aid Jesse</p>
<p>I did try that, and even removed all returns and tabs&#8230;just wrote the xml as one long line:</p>
<p>&#8216;xml = <tour><br />
<section name="checkpoint_1"><video path="C1Enter.mov" key="f" section="checkpoint_1"></video><video path="C1Left.mov" key="l" section="checkpoint_10a"></video><video path="C1Right.mov" key="r" section="checkpoint_2a"></video></section>
<section name="checkpoint_2a"><video path="C2Enter.mov" key="r" section="checkpoint_2a"></video><video path="C2Back.mov" key="b" section="checkpoint_1"></video><video path="C2Forward.mov" key="f" section="checkpoint_3a"></video></section>
<section name="checkpoint_2b"><video path="C2Enter.mov" key="l" section="checkpoint_2a"></video><video path="C2Back.mov" key="f" section="checkpoint_1b"></video><video path="C2Forward.mov" key="b" section="checkpoint_3a"></video></section>
<section name="checkpoint_3a"><video path="C3Enter.mov" key="r" section="checkpoint_3a"></video><video path="C3Back.mov" key="b" section="checkpoint_2b"></video><video path="C3Forward.mov" key="f" section="checkpoint_4a"></video></section>
<section name="checkpoint_3b"><video path="C3Enter.mov" key="l" section="checkpoint_3a"></video><video path="C3Back.mov" key="f" section="checkpoint_2b"></video><video path="C3Forward.mov" key="b" section="checkpoint_3a"></video></section>
<section name="checkpoint_4a"><video path="C4Enter.mov" key="r" section="checkpoint_4a"></video><video path="C4Back.mov" key="b" section="checkpoint_3b"></video><video path="C4Forward.mov" key="f" section="checkpoint_5a"></video></section>
<section name="checkpoint_4b"><video path="C4Enter.mov" key="l" section="checkpoint_4a"></video><video path="C4Back.mov" key="f" section="checkpoint_3b"></video><video path="C4Forward.mov" key="b" section="checkpoint_5a"></video></section>
<section name="checkpoint_5a"><video path="C4Enter.mov" key="l" section="checkpoint_4a"></video><video path="C4Back.mov" key="f" section="checkpoint_3b"></video><video path="C4Forward.mov" key="b" section="checkpoint_5a"></video></section>
<section name="checkpoint_5b"><video path="C4Enter.mov" key="l" section="checkpoint_4a"></video><video path="C4Back.mov" key="f" section="checkpoint_3b"></video><video path="C4Forward.mov" key="b" section="checkpoint_5a"></video></section>
<p></p></tour>;&#8217;</p>
<p>That behaves exactly like the before, crashing :(</p>
<p>Any clues/ideas ?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179713</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179713</link>
					<pubDate>Fri, 30 Apr 2010 13:38:40 +0000</pubDate>
					<dc:creator>Hans Höglund</dc:creator>

					<description>
						<![CDATA[
						<p>Max uses the SpiderMonkey javascript engine (by Mozilla). Try checking their lists and docs for bugs related to XML.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179714</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179714</link>
					<pubDate>Sat, 01 May 2010 12:28:52 +0000</pubDate>
					<dc:creator>george.profenza</dc:creator>

					<description>
						<![CDATA[
						<p>Hello Hans,</p>
<p>I had a quick look at the SpiderMonkey, but I find it hard to track down if indeed my problem is a listed bug:<br />
<a href="https://bugzilla.mozilla.org/buglist.cgi?bug_status=NEW&#038;bug_status=ASSIGNED&#038;bug_status=REOPENED&#038;component=Javascript+Engine" rel="nofollow">https://bugzilla.mozilla.org/buglist.cgi?bug_status=NEW&#038;bug_status=ASSIGNED&#038;bug_status=REOPENED&#038;component=Javascript+Engine</a><br />
I&#8217;ve looked for &#8216;limit&#8217; and &#8216;E4X&#8217;</p>
<p>This would be a major bug in SpiderMonkey though. Not sure if SpiderMonkey is used under the hood by actionscript, but the same code works well/doesn&#8217;t crash flash player.</p>
<p>Maybe there&#8217;s a problem with the text editor in Max and E4X.</p>
<p>Thanks for the hint.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179715</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179715</link>
					<pubDate>Sat, 01 May 2010 15:35:10 +0000</pubDate>
					<dc:creator>Hans Höglund</dc:creator>

					<description>
						<![CDATA[
						<p>Hm. According to the docs (<a href="http://cycling74.com/docs/max5/vignettes/js/jsintro.html" rel="nofollow">http://cycling74.com/docs/max5/vignettes/js/jsintro.html</a>) Max supports version 1.5 of JavaScript. </p>
<p>But E4X was added in 1.6, right?</p>
<p><a href="https://developer.mozilla.org/en/New_in_JavaScript_1.6" rel="nofollow">https://developer.mozilla.org/en/New_in_JavaScript_1.6</a></p>
<p>I guess that the pre 1.6 versions of SpiderMonkey contained an experimental implementation of E4X, and what you encountered is actually a bug in that version that was later fixed for the 1.6 release.</p>
<p>A workaround could be to use the Rhino interpreter instead, through an mxj object.</p>
<p><a href="http://www.mozilla.org/rhino/" rel="nofollow">http://www.mozilla.org/rhino/</a></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179716</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179716</link>
					<pubDate>Sat, 01 May 2010 15:38:22 +0000</pubDate>
					<dc:creator>Hans Höglund</dc:creator>

					<description>
						<![CDATA[
						<p>Btw, Flash Player use Tamarin, not SpiderMonkey.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179717</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179717</link>
					<pubDate>Tue, 04 May 2010 19:35:19 +0000</pubDate>
					<dc:creator>Brian Gruber</dc:creator>

					<description>
						<![CDATA[
						<p>i&#8217;m curious&#8230; what happens if you construct the XML object by doing <code>new XML(&#39;the xml as as string&#39;)</code> instead?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179718</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179718</link>
					<pubDate>Tue, 11 May 2010 13:02:43 +0000</pubDate>
					<dc:creator>george.profenza</dc:creator>

					<description>
						<![CDATA[
						<p>@Hans You are perfectly right. There is not support for Javascript 1.6 yet and the code worked here and there because of the experimental E4X implementation.</p>
<p>I will follow the documentation and try to see how I get along with Rhino :)</p>
<p>Thanks,<br />
George</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179719</guid>
					<title><![CDATA[Re: Max Crashes when using js and xml]]></title>
					<link>http://cycling74.com/forums/topic/max-crashes-when-using-js-and-xml/#post-179719</link>
					<pubDate>Wed, 19 May 2010 01:41:57 +0000</pubDate>
					<dc:creator>tom@swirly.com</dc:creator>

					<description>
						<![CDATA[
						<p>Let me also recommend against using XML &#8211; it&#8217;s a sucky format for data interchange for numerous reasons.</p>
<p>If you have the choice, strongly consider using JSON.  It&#8217;s far easier to read in Javascript (you can just paste it into your code, it&#8217;s valid Javascript) and doesn&#8217;t have the &#8220;two sorts of containment&#8221; issue that makes XML such a drag.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

