{"id":2480,"date":"2011-10-06T08:06:41","date_gmt":"2011-10-06T06:06:41","guid":{"rendered":"https:\/\/iguanademos.com\/Jare\/wp\/?p=2480"},"modified":"2012-01-28T22:28:55","modified_gmt":"2012-01-28T20:28:55","slug":"flash-stage-3d-is-out","status":"publish","type":"post","link":"https:\/\/iguanademos.com\/Jare\/wp\/?p=2480","title":{"rendered":"Flash Stage 3D is out!"},"content":{"rendered":"<p>A couple of days ago, Adobe released to the masses a new version of their Flash Player, and an updated SDK. The biggest change (for me at least) is the inclusion of hardware-accelerated 3D, known as <a href=\"http:\/\/www.adobe.com\/devnet\/flashplayer\/stage3d.html\" target=\"_blank\">Stage3D<\/a>. Here&#8217;s a quick tour of what I did to compile and run my first Stage3D program (Windows 7 PC but should be applicable everywhere). Useful because the Adobe site is not really clear about this.<\/p>\n<p><!--more--><\/p>\n<ul>\n<li>Make sure you have a Java runtime installed, you need it for the Flash compiler.<\/li>\n<li>Download <a href=\"http:\/\/download.macromedia.com\/pub\/flex\/sdk\/flex_sdk_4.5.1.zip\" target=\"_blank\">Flash SDK 4.5.1<\/a> from <a href=\"http:\/\/opensource.adobe.com\/wiki\/display\/flexsdk\/Flex+SDK\" target=\"_blank\">http:\/\/opensource.adobe.com\/wiki\/display\/flexsdk\/Flex+SDK<\/a>. Extract to a folder (I will assume <strong>flex_sdk_4.5.1<\/strong>).<\/li>\n<li>Download the appropriate versions of the debug, standalone and plugin Flash Player 11 from <a href=\"http:\/\/www.adobe.com\/support\/flashplayer\/downloads.html\" target=\"_blank\">http:\/\/www.adobe.com\/support\/flashplayer\/downloads.html<\/a>.<\/li>\n<li>While you&#8217;re there, download the latest <a href=\"http:\/\/fpdownload.macromedia.com\/pub\/flashplayer\/updaters\/11\/playerglobal11_0.swc\">Flash Runtime library<\/a>.<\/li>\n<li>Inside the folder <strong>flex_sdk_4.5.1\/frameworks\/libs\/player\/<\/strong> create a folder &#8220;<strong>11.0<\/strong>&#8220;. Copy the <strong>playerglobal11_0.swc<\/strong> you just downloaded inside that folder, and rename it to <strong>playerglobal.swc<\/strong>. Result:<br \/>\n<strong>flex_sdk_4.5.1\/frameworks\/libs\/player\/11.0\/playerglobal.swc<\/strong>.<\/li>\n<li>Create your working folder, and copy the <a href=\"http:\/\/help.adobe.com\/en_US\/FlashPlatform\/reference\/actionscript\/3\/flash\/display3D\/Context3D.html#includeExamplesSummary\" target=\"_blank\">rotating cube example<\/a> from the Adobe docs into a file called <strong>Context3DExample.as<\/strong>.<\/li>\n<li>Delete line 59: <strong>this.stage.nativeWindow.activate(); \/\/AIR only<\/strong> and also remove the third &#8220;<strong>false<\/strong>&#8221; parameter from the calls to <strong>assemble()<\/strong> from lines 70 and 71.<\/li>\n<li>Download the <a href=\"https:\/\/github.com\/flashplatformsdk\/Flash-Platform-SDK\/zipball\/master\">Flash Platform SDK<\/a> as a ZIP file. Extract the contents of &#8220;<strong>src<\/strong>&#8221; in your work folder. This should result in a folder called &#8220;<strong>com<\/strong>&#8221; side by side with the file &#8220;<strong>Context3DExample.as<\/strong>&#8220;.<\/li>\n<li>Compile the sample: <strong>flex_sdk_4.5.1\/bin\/mxmlc -static-link-runtime-shared-libraries -swf-version=13 -target-player=11.0 Context3DExample.as<\/strong>. Note the <strong>swf-version<\/strong> and <strong>target-player<\/strong> parameters.<\/li>\n<li>Run the resulting SWF file with the standalone player 11 you downloaded, or embed it inside a web page. Important: for Stage3D to work properly on hardware, you must add the parameter <strong>&lt;param value=&#8221;direct&#8221; name=&#8221;wmode&#8221;&gt;<\/strong> to the swf <strong>&lt;object&gt;<\/strong> tag, and the attribute <strong>wmode=&#8221;direct&#8221;<\/strong> to the <strong>&lt;embed&gt;<\/strong> tag.<\/li>\n<\/ul>\n<p>The result should be a spinning cube like this (only visible if you have the updated plugin):<\/p>\n<p>[kml_flashembed publishmethod=&#8221;static&#8221; fversion=&#8221;11.0.0&#8243; movie=&#8221;\/Jare\/files\/Stage3D\/Test3D.swf&#8221; width=&#8221;320&#8243; height=&#8221;240&#8243; targetclass=&#8221;flashmovie&#8221; wmode=&#8221;direct&#8221;]<\/p>\n<p><a href=\"http:\/\/adobe.com\/go\/getflashplayer\"><img decoding=\"async\" src=\"http:\/\/www.adobe.com\/images\/shared\/download_buttons\/get_flash_player.gif\" alt=\"Get Adobe Flash player\" \/><\/a><\/p>\n<p>[\/kml_flashembed]<\/p>\n<p>Further reading and links:<\/p>\n<ul>\n<li><a href=\"http:\/\/help.adobe.com\/en_US\/FlashPlatform\/reference\/actionscript\/3\/package-summary.html\" target=\"_blank\">Flash SDK documentation<\/a><\/li>\n<li><a href=\"http:\/\/help.adobe.com\/en_US\/as3\/dev\/WSd6a006f2eb1dc31e-310b95831324724ec56-8000.html\" target=\"_blank\">Shader assembler docs<\/a> from <a href=\"http:\/\/help.adobe.com\/en_US\/as3\/dev\/index.html\" target=\"_blank\">http:\/\/help.adobe.com\/en_US\/as3\/dev\/index.html<\/a><\/li>\n<li><a href=\"http:\/\/www.flashdevelop.org\/wikidocs\/index.php?title=Main_Page\" target=\"_blank\">FlashDevelop<\/a> for a convenient IDE.<\/li>\n<li><a href=\"http:\/\/www.adobe.com\/devnet\/flashplayer\/stage3d.html\" target=\"_blank\">Stage3D demos and frameworks\/libraries<\/a>.<\/li>\n<\/ul>\n<p>Happy 3D&#8217;ing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of days ago, Adobe released to the masses a new version of their Flash Player, and an updated SDK. The biggest change (for me at least) is the inclusion of hardware-accelerated 3D, known as Stage3D. Here&#8217;s a quick &hellip; <a href=\"https:\/\/iguanademos.com\/Jare\/wp\/?p=2480\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[14,7,15],"class_list":["post-2480","post","type-post","status-publish","format-standard","hentry","category-development","tag-flash","tag-install","tag-stage3d"],"_links":{"self":[{"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2480"}],"version-history":[{"count":10,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2480\/revisions"}],"predecessor-version":[{"id":2569,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2480\/revisions\/2569"}],"wp:attachment":[{"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}