{"id":323,"date":"2009-06-22T09:45:15","date_gmt":"2009-06-22T16:45:15","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=1611"},"modified":"2009-06-22T09:45:15","modified_gmt":"2009-06-22T16:45:15","slug":"xml-to-actionscript-3-asxml","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=323","title":{"rendered":"XML to ActionScript #3 (AsXML)"},"content":{"rendered":"<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;code&gt;\r\n  &lt;make reference=&quot;w&quot; class=&quot;BasicView&quot; args=&quot;stage.stageWidth, stage.stageHeight, false&quot;\/&gt;\r\n  &lt;call method=&quot;addChild&quot; args=&quot;w&quot;\/&gt;\r\n  \r\n  &lt;make reference=&quot;wireMat&quot; class=&quot;WireframeMaterial&quot; args=&quot;0x000000&quot; \/&gt;\r\n  \r\n  &lt;make reference=&quot;sphere&quot; class=&quot;Sphere&quot; args=&quot;wireMat, 100&quot; \/&gt;\r\n  \r\n  &lt;call method=&quot;w.scene.addChild&quot; args=&quot;sphere&quot; \/&gt;\r\n  \r\n  &lt;make reference=&quot;animation&quot; class=&quot;Object&quot; &gt;\r\n    &lt;set z=&quot;-500&quot; rotationY=&quot;360&quot;  rotationX=&quot;360&quot; ease=&quot;Back.easeOut&quot;\/&gt;\r\n  &lt;\/make&gt;\r\n  \r\n  &lt;call method=&quot;TweenLite.to&quot; args=&quot;sphere, 3, animation&quot; \/&gt;\r\n  \r\n  &lt;call method=&quot;setInterval&quot; args=&quot;w.singleRender, 32&quot; \/&gt;\r\n  \r\n&lt;\/code&gt;\r\n<\/pre>\n<p><i>This snippet shows XML that the mini-library AsXML can read and run &#8211; in this case AsXML is set up to run with Papervision<\/i><\/p>\n<p>A few days ago I had the idea to write some code that would run ActionScript based on XML. I spent some time getting rid of a few bugs and setting up some demos with <a href=\"http:\/\/blog.greensock.com\/tweenliteas3\/\" target=\"blank\">TweenLite<\/a>, <a href=\"http:\/\/blog.papervision3d.org\/\" target=\"blank\">Papervision<\/a> and <a href=\"https:\/\/actionsnippet.com\/?page_id=1391\" target=\"blank\">QuickBox2D<\/a>. I wrapped everything up into a mini-library called AsXML.<\/p>\n<p><a href=\"https:\/\/actionsnippet.com\/asxml\/\" target=\"blank\">Check out the demos here.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/actionsnippet.com\/wp-content\/asxml_pv3d.gif\" \/><br \/>\n<\/a><\/p>\n<p><a href=\"https:\/\/actionsnippet.com\/asxml\/asxml_1.zip\">Download AsXML and demo files here.<\/a><\/p>\n<p>AsXML Features:<br \/>\n1) call methods of the main timeline<br \/>\n2) read and write properties on the main timeline<br \/>\n3) instantiate classes on the main timeline<br \/>\n4) call methods on these classes<br \/>\n5) read and write properties on these classes<br \/>\n6) store references to return values from functions<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;code&gt; &lt;make reference=&quot;w&quot; class=&quot;BasicView&quot; args=&quot;stage.stageWidth, stage.stageHeight, false&quot;\/&gt; &lt;call method=&quot;addChild&quot; args=&quot;w&quot;\/&gt; &lt;make reference=&quot;wireMat&quot; class=&quot;WireframeMaterial&quot; args=&quot;0x000000&quot; \/&gt; &lt;make reference=&quot;sphere&quot; class=&quot;Sphere&quot; args=&quot;wireMat, 100&quot; \/&gt; &lt;call method=&quot;w.scene.addChild&quot; args=&quot;sphere&quot; \/&gt; &lt;make reference=&quot;animation&quot; class=&quot;Object&quot; &gt; &lt;set z=&quot;-500&quot; rotationY=&quot;360&quot; rotationX=&quot;360&quot; ease=&quot;Back.easeOut&quot;\/&gt; &lt;\/make&gt; &lt;call method=&quot;TweenLite.to&quot; args=&quot;sphere, 3, animation&quot; \/&gt; &lt;call method=&quot;setInterval&quot; args=&quot;w.singleRender, 32&quot; \/&gt; &lt;\/code&gt; This snippet shows XML that the mini-library AsXML [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,9,88,33,55,121,94,13,12,18,20,21,34],"tags":[3,14,4],"class_list":["post-323","post","type-post","status-publish","format-standard","hentry","category-box2d","category-dynamic","category-external-data","category-graphics","category-instantiation","category-math","category-misc","category-motion","category-quickbox2d","category-return-values","category-string-manipulation","category-strings","category-xml","tag-actionscript","tag-as3","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=323"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/323\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}