Away3D Forum http://away3d.com/forum/ Away3D Forum en Copyright 2017 2017-02-06T00:24:55+00:00 Building examples with FlashDevelop http://away3d.com/forum/viewthread/6199/ http://away3d.com/forum/viewthread/6199/#When:00:24:55Z <p>Hi, I’m an AS3 developer and I’ve decided to give AwayJS a try. I’m really new to TypeScript, though.<br /> I have set up Node.js and I can successfully build the basic “Hello World” example in FlashDevelop.<br /> But when I try to build any of the AwayJS examples, I get several errors like this:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">src</span><span style="color: #007700">/</span><span style="color: #0000BB">awayjs</span><span style="color: #007700">-</span><span style="color: #0000BB">full</span><span style="color: #007700">/</span><span style="color: #0000BB">lib</span><span style="color: #007700">/</span><span style="color: #0000BB">view</span><span style="color: #007700">.</span><span style="color: #0000BB">ts</span><span style="color: #007700">(</span><span style="color: #0000BB">15</span><span style="color: #007700">,</span><span style="color: #0000BB">65</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">error&nbsp;TS2307</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">Cannot&nbsp;find&nbsp;module&nbsp;</span><span style="color: #DD0000">'@awayjs/view'</span><span style="color: #007700">.&nbsp;</span> </span> </code></div> <p>...and this:</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">src</span><span style="color: #007700">/</span><span style="color: #0000BB">Basic_View</span><span style="color: #007700">.</span><span style="color: #0000BB">ts</span><span style="color: #007700">(</span><span style="color: #0000BB">42</span><span style="color: #007700">,</span><span style="color: #0000BB">9</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">error&nbsp;TS2305</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">Module&nbsp;</span><span style="color: #DD0000">'"/awayjs-examples/src/awayjs-full/lib/view"'&nbsp;</span><span style="color: #0000BB">has&nbsp;no&nbsp;exported&nbsp;member&nbsp;</span><span style="color: #DD0000">'View'</span><span style="color: #007700">.&nbsp;</span> </span> </code></div> <p>Not sure what I’m doing wrong.</p> <p>- Is there any tutorial that explains how to build a basic AwayJS example using FlashDevelop?<br /> - Is FlashDevelp ok or should I change to Visual Studio Code or similar?</p> 2017-02-06T00:24:55+00:00 Awayjs with gulp workflow http://away3d.com/forum/viewthread/6113/ http://away3d.com/forum/viewthread/6113/#When:15:45:38Z <p>I was actionscript script developer, and I have a lot of practice using away3d in flash player, now I am styding typescript and want to continue use awayjs in my everyday practice to developing games and data visualisation projects. Because of I really new in nowadays javascript workflow, I can’t finally understand how to import awayjs. I make a standart greeter workflow with npm, gulp tasks, tsd compilator and bundle functions such as browserify, sourcemaps and so on. Then I install awayjs-full using npm;</p> <p>- npm install awayjs-full—save-dev<br /> - npm install awayjs-full—save</p> <p>Then I can import library in typescript source code:</p> <p>import * as awayjs from “awayjs-full”;</p> <p>And Typescript see all classes, but the problem is when I try to bundle compiled .js the bundle gulp task through error ‘can not find module “awayjs-full’ ‘. Javascript compiled file could not require awayjs-full. What I miss to finally let everything works together?</p> <p>Sorry for my bad knowledges of javascript workflow, I understand that my question is not about awayjs usage, but I can not find any answer on google and stackoferlow. As far as I understand awayjs is extremely new for nowaday practice, that why there is no any articles with simple start. Maybe I should add a DefinitelyTyped for typimgs reposirory, or something like that?</p> 2016-07-01T15:45:38+00:00 What is the direction of Away Fundation? Is Away JS/TypeScript still the future? http://away3d.com/forum/viewthread/6094/ http://away3d.com/forum/viewthread/6094/#When:18:08:50Z <p>Hello, what is the direction of Away Foundation? <br /> Is Away JS/TypeScript still the future or has the foundation steered in a new direction again? It looks like Away3d TypeScript commits are rare. After completing several projects on Away3d AS3, I invested significant time working on Away3d TypeScript using TS 1.5 version but it does not look like the library is keeping up with the TypeScript org which is now on version 1.8 I believe. To be honest I am not even sure what is the highest version of TypeScript supported by the Away library because I cannot find that info anywhere on the site. So what is the future made of for the Away3D library? back to AS3, forward with TypeScript, or turn to Haxe. There is so little communication on direction and setting up environments that it is hard to know what is going on. I want to promote Away3D in TypeScript because of the time I invested but it is a tough sell with other developers as they cannot find up to date information to get started and also there is nothing that indicates library/product direction. Is the Foundation in limbo or is everyone just too busy to communicate with the user community, not sure what is going on anymore, please advise. Thank you.</p> 2016-05-13T18:08:50+00:00 Loading Custom Mesh fail in one case but not in another case http://away3d.com/forum/viewthread/5981/ http://away3d.com/forum/viewthread/5981/#When:08:52:37Z <p>I have two programs that load the same .obj file in an identical way yet in one program the assetType returned is Geometry with a name set to null and no further processing (so no mesh). In the other program the assetType is [asset Geometry] at first but then a second event (not triggered by me) occurs and the assetType on that second event is [asset Mesh]. Network traffic in the browser shows that the .obj file itself has been properly loaded in both case.</p> <p>Any idea why would that be? I am attaching some snippets of code here:</p> <p>Both programs initiate the .obj asset loading in that way:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">token&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">AssetLibrary</span><span style="color: #007700">.</span><span style="color: #0000BB">load</span><span style="color: #007700">(new&nbsp;</span><span style="color: #0000BB">URLRequest</span><span style="color: #007700">(</span><span style="color: #DD0000">'_assets/tile.obj'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">token</span><span style="color: #007700">.</span><span style="color: #0000BB">addEventListener</span><span style="color: #007700">(</span><span style="color: #0000BB">LoaderEvent</span><span style="color: #007700">.</span><span style="color: #0000BB">RESOURCE_COMPLETE</span><span style="color: #007700">,&nbsp;(</span><span style="color: #0000BB">event</span><span style="color: #007700">:</span><span style="color: #0000BB">LoaderEvent</span><span style="color: #007700">)&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">onResourceComplete</span><span style="color: #007700">(</span><span style="color: #0000BB">event</span><span style="color: #007700">));&nbsp;</span> </span> </code></div> <p>onResourceComplete() function of broken program:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">onResourceComplete</span><span style="color: #007700">(</span><span style="color: #0000BB">event</span><span style="color: #007700">:</span><span style="color: #0000BB">LoaderEvent</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">loader</span><span style="color: #007700">:</span><span style="color: #0000BB">AssetLoader&nbsp;</span><span style="color: #007700">=&nbsp;&lt;</span><span style="color: #0000BB">AssetLoader</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">event</span><span style="color: #007700">.</span><span style="color: #0000BB">target</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;</span><span style="color: #0000BB">l</span><span style="color: #007700">:</span><span style="color: #0000BB">number&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">loader</span><span style="color: #007700">.</span><span style="color: #0000BB">baseDependency</span><span style="color: #007700">.</span><span style="color: #0000BB">assets</span><span style="color: #007700">.</span><span style="color: #0000BB">length</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">console</span><span style="color: #007700">.</span><span style="color: #0000BB">log</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">'away.events.LoaderEvent.RESOURCE_COMPLETE'&nbsp;</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">event&nbsp;</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">l</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">loader&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">:</span><span style="color: #0000BB">number&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">l</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">++)&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">:</span><span style="color: #0000BB">IAsset&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">loader</span><span style="color: #007700">.</span><span style="color: #0000BB">baseDependency</span><span style="color: #007700">.</span><span style="color: #0000BB">assets[i]</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">console</span><span style="color: #007700">.</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"assetType:"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"name:"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">name</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"url:"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">event</span><span style="color: #007700">.</span><span style="color: #0000BB">url</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">console</span><span style="color: #007700">.</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"Mesh.assetType&nbsp;is&nbsp;"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Mesh</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch&nbsp;(</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">case&nbsp;&nbsp;</span><span style="color: #0000BB">Mesh</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType</span><span style="color: #007700">:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//That&nbsp;case&nbsp;never&nbsp;gets&nbsp;triggered?&nbsp;but&nbsp;it&nbsp;does&nbsp;in&nbsp;the&nbsp;other&nbsp;program&nbsp;that&nbsp;works?<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">event</span><span style="color: #007700">.</span><span style="color: #0000BB">url&nbsp;</span><span style="color: #007700">==</span><span style="color: #DD0000">'_assets/tile.obj'</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this</span><span style="color: #007700">.</span><span style="color: #0000BB">_tileMesh&nbsp;</span><span style="color: #007700">=&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">Mesh</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//some&nbsp;code&nbsp;removed&nbsp;for&nbsp;brievety&nbsp;sake&nbsp;here<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;</span><span style="color: #0000BB">TextureBase</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType&nbsp;</span><span style="color: #007700">:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//unrelated&nbsp;and&nbsp;properly&nbsp;working&nbsp;code&nbsp;here&nbsp;has&nbsp;been&nbsp;removed&nbsp;for&nbsp;brievety&nbsp;sake<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</span> </span> </code></div> <p>onResourceComplete() function of working program:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">onResourceComplete</span><span style="color: #007700">(</span><span style="color: #0000BB">event</span><span style="color: #007700">:</span><span style="color: #0000BB">LoaderEvent</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">{&nbsp;</span><span style="color: #FF8000">//that&nbsp;is&nbsp;taken&nbsp;from&nbsp;one&nbsp;the&nbsp;example&nbsp;program&nbsp;that&nbsp;I&nbsp;simplified&nbsp;a&nbsp;bit<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">loader</span><span style="color: #007700">:</span><span style="color: #0000BB">AssetLoader&nbsp;</span><span style="color: #007700">=&nbsp;&lt;</span><span style="color: #0000BB">AssetLoader</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">event</span><span style="color: #007700">.</span><span style="color: #0000BB">target</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;</span><span style="color: #0000BB">l</span><span style="color: #007700">:</span><span style="color: #0000BB">number&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">loader</span><span style="color: #007700">.</span><span style="color: #0000BB">baseDependency</span><span style="color: #007700">.</span><span style="color: #0000BB">assets</span><span style="color: #007700">.</span><span style="color: #0000BB">length</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">console</span><span style="color: #007700">.</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">'away.events.LoaderEvent.RESOURCE_COMPLETE'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">event</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">l</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">loader</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">:</span><span style="color: #0000BB">number&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">c&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">l</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">++)&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">:</span><span style="color: #0000BB">IAsset&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">loader</span><span style="color: #007700">.</span><span style="color: #0000BB">baseDependency</span><span style="color: #007700">.</span><span style="color: #0000BB">assets[c]</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">console</span><span style="color: #007700">.</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"assetType:"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"name:"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">name</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"url:"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">event</span><span style="color: #007700">.</span><span style="color: #0000BB">url</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch&nbsp;(</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">case&nbsp;&nbsp;</span><span style="color: #0000BB">Mesh</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType</span><span style="color: #007700">:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//That&nbsp;case&nbsp;gets&nbsp;triggered&nbsp;in&nbsp;that&nbsp;program<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">event</span><span style="color: #007700">.</span><span style="color: #0000BB">url&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #DD0000">'_assets/tile.obj'</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">mesh</span><span style="color: #007700">:</span><span style="color: #0000BB">Mesh&nbsp;</span><span style="color: #007700">=&nbsp;&lt;</span><span style="color: #0000BB">Mesh</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//some&nbsp;code&nbsp;removed&nbsp;for&nbsp;brievety&nbsp;sake&nbsp;here<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;</span><span style="color: #0000BB">TextureBase</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType&nbsp;</span><span style="color: #007700">:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//unrelated&nbsp;and&nbsp;properly&nbsp;working&nbsp;code&nbsp;here&nbsp;has&nbsp;been&nbsp;removed&nbsp;for&nbsp;brievety&nbsp;sake<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">mat&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">spartanFlag</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">:</span><span style="color: #0000BB">number&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">c&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">meshes</span><span style="color: #007700">.</span><span style="color: #0000BB">length</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">c</span><span style="color: #007700">++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">meshes[c]</span><span style="color: #007700">.</span><span style="color: #0000BB">material&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">mat</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">view</span><span style="color: #007700">.</span><span style="color: #0000BB">scene</span><span style="color: #007700">.</span><span style="color: #0000BB">addChild</span><span style="color: #007700">(</span><span style="color: #0000BB">this</span><span style="color: #007700">.</span><span style="color: #0000BB">doc</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">}&nbsp;</span> </span> </code></div> 2015-11-21T08:52:37+00:00 How to implement the ‘.extra’ attributes that I was able to to in as3 (and other generaly typescript info..) http://away3d.com/forum/viewthread/5827/ http://away3d.com/forum/viewthread/5827/#When:13:42:37Z <p>Hi there,</p> <p>really impressed with everything so far, working my way through converting an old project.</p> <p>I’ve come up against a problem though, in that previously I used .extra attributes to store a load of extra information on a generated cube, and I’m wondering how to do this in typescript..</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">p</span><span style="color: #007700">.</span><span style="color: #0000BB">extra&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;&nbsp;&nbsp;index</span><span style="color: #007700">:</span><span style="color: #0000BB">number</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">target</span><span style="color: #007700">:</span><span style="color: #0000BB">number</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">origX</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">number</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">origY</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">number</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">origZ</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">number</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">actualX</span><span style="color: #007700">:</span><span style="color: #0000BB">number</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">actualY</span><span style="color: #007700">:</span><span style="color: #0000BB">number</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">actualZ</span><span style="color: #007700">:</span><span style="color: #0000BB">number</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">parentRot</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">number</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">imgQual</span><span style="color: #007700">:</span><span style="color: #0000BB">number<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;}&nbsp;</span> </span> </code></div> <p>(‘p’ is a cube.)<br /> But from that I get </p> <blockquote><p> error TS2304: Cannot find name ‘number’.</p> </blockquote> <p>How would I go about this? Or would I have to make a new class which has the attributes I need? (Possibly the ‘correct’ way to go about it anyway…)</p> 2015-03-26T13:42:37+00:00 Can’t import my own AWDs… http://away3d.com/forum/viewthread/5826/ http://away3d.com/forum/viewthread/5826/#When:20:38:21Z <p>Sooo…</p> <p>Carrying on experimenting, trying to convert my old projects etc, and I’m up against a bit of a stumbling block in that I can’t export any AWD that I export from prefab3D.</p> <p>Obj’s straight out of blender are fine, as are objs exported from prefab, but for some reason AWDs never load. </p> <p>The supplied suzanne from the examples works fine in what I’m doing, and I assume that the rest of the awds form the examples do too.</p> <p>Can’t figure it out, I’ve tried various combinations of exporting the whole scene, exporting just the selected, no materials etc but still nothing..</p> 2015-03-24T20:38:21+00:00 Can’t figure out where the away3d.js bits should be for the examples? http://away3d.com/forum/viewthread/5818/ http://away3d.com/forum/viewthread/5818/#When:20:19:55Z <p>I previously had the examples working, by following the tutorial here:</p> <p>http://away3d.com/tutorials/Away3D_TypeScript_-_Getting_Started</p> <p>But now I can’t seem to do it.</p> <p>I get:</p> <p>Cannot compile external modules unless the ‘—module’ flag is provided.</p> <p>Which makes sense to me, as I can’t see that the awayjs bits are included anywhere…</p> <p>What am I missing?</p> 2015-03-13T20:19:55+00:00 Examples don’t compile http://away3d.com/forum/viewthread/5707/ http://away3d.com/forum/viewthread/5707/#When:22:50:39Z <p>Hello</p> <p>Are there any steps which should we follow to compile successfully typescripts to javascripts with new typescript compilers? I mean for example those examples that are in github? The newest. <br /> https://github.com/awayjs/awayjs-examples</p> <p>I tried little bit by myself but first there where some errors in Bitmap Data classes : Uint8Array , number. Second merging files with gulp doesn’t work for me good.</p> <p>Thanks for any information.</p> 2014-10-28T22:50:39+00:00