Away3D Forum 0 Copyright (c) 2017 ExpressionEngine tag:away3d.com,2017:02:06 Building examples with FlashDevelop tag:away3d.com,2017:forum/viewthread/.6199 2017-02-06T00:24:55Z 0 Hector Hi, I’m an AS3 developer and I’ve decided to give AwayJS a try. I’m really new to TypeScript, though.
I have set up Node.js and I can successfully build the basic “Hello World” example in FlashDevelop.
But when I try to build any of the AwayJS examples, I get several errors like this:

src/awayjs-full/lib/view.ts(15,65): error TS2307Cannot find module '@awayjs/view'

...and this:

src/Basic_View.ts(42,9): error TS2305Module '"/awayjs-examples/src/awayjs-full/lib/view"' has no exported member 'View'

Not sure what I’m doing wrong.

- Is there any tutorial that explains how to build a basic AwayJS example using FlashDevelop?
- Is FlashDevelp ok or should I change to Visual Studio Code or similar?

]]>
Awayjs with gulp workflow tag:away3d.com,2016:forum/viewthread/.6113 2016-07-01T15:45:38Z 0 inozemcev 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;

- npm install awayjs-full—save-dev
- npm install awayjs-full—save

Then I can import library in typescript source code:

import * as awayjs from “awayjs-full”;

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?

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?

]]>
What is the direction of Away Fundation? Is Away JS/TypeScript still the future? tag:away3d.com,2016:forum/viewthread/.6094 2016-05-13T18:08:50Z 0 Ludovic Hello, what is the direction of Away Foundation?
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.

]]>
Loading Custom Mesh fail in one case but not in another case tag:away3d.com,2015:forum/viewthread/.5981 2015-11-21T08:52:37Z 0 Ludovic 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.

Any idea why would that be? I am attaching some snippets of code here:

Both programs initiate the .obj asset loading in that way:

this.token AssetLibrary.load(new URLRequest('_assets/tile.obj'));
this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); 

onResourceComplete() function of broken program:

private onResourceComplete(event:LoaderEvent)
    
{
        
var loader:AssetLoader = <AssetLoaderevent.target;
        var 
l:number loader.baseDependency.assets.length;
        
console.log'away.events.LoaderEvent.RESOURCE_COMPLETE' event lloader );
        for (var 
i:number 0li++) {
            
var asset:IAsset loader.baseDependency.assets[i];
            
console.log("assetType:"asset.assetType"name:"asset.name"url:"event.url);
            
console.log("Mesh.assetType is "Mesh.assetType);
            switch (
asset.assetType{
                
case  Mesh.assetType:
                    
//That case never gets triggered? but it does in the other program that works?
                    
if (event.url =='_assets/tile.obj'{
                        this
._tileMesh =  <Meshasset;
                        
//some code removed for brievety sake here
                    
}
                    
break;
                case 
TextureBase.assetType :
                    
//unrelated and properly working code here has been removed for brievety sake
                    
break;
            
}
        }
    } 

onResourceComplete() function of working program:

public onResourceComplete(event:LoaderEvent//that is taken from one the example program that I simplified a bit
        
var loader:AssetLoader = <AssetLoaderevent.target;
        var 
l:number loader.baseDependency.assets.length;
        
console.log('away.events.LoaderEvent.RESOURCE_COMPLETE'eventlloader);
        for (var 
c:number 0lc++) {
            
var asset:IAsset loader.baseDependency.assets[c];
            
console.log("assetType:"asset.assetType"name:"asset.name"url:"event.url);
            switch (
asset.assetType{
                
case  Mesh.assetType:
                    
//That case gets triggered in that program
                    
if (event.url == '_assets/tile.obj'{
                        
var mesh:Mesh = <Meshasset;
                        
//some code removed for brievety sake here
                    
}
                    
break;
                case 
TextureBase.assetType :
                    
//unrelated and properly working code here has been removed for brievety sake
                    
break;
            
}
        }
        
if (this.mat && this.spartanFlag)
            for (var 
c:number 0this.meshes.lengthc++)
                
this.meshes[c].material this.mat;
        
this.view.scene.addChild(this.doc);
    
]]>
How to implement the ‘.extra’ attributes that I was able to to in as3 (and other generaly typescript info..) tag:away3d.com,2015:forum/viewthread/.5827 2015-03-26T13:42:37Z 0 Mr Margaret Scratcher Hi there,

really impressed with everything so far, working my way through converting an old project.

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.extra {
    index
:number,
    
target:number,
    
origXnumber,
    
origYnumber,
    
origZnumber,
    
actualX:number,
    
actualY:number,
    
actualZ:number,
    
parentRotnumber,
    
imgQual:number
    
   } 

(‘p’ is a cube.)
But from that I get

error TS2304: Cannot find name ‘number’.

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…)

]]>
Can’t import my own AWDs… tag:away3d.com,2015:forum/viewthread/.5826 2015-03-24T20:38:21Z 0 Mr Margaret Scratcher Sooo…

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.

Obj’s straight out of blender are fine, as are objs exported from prefab, but for some reason AWDs never load.

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.

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..

]]>
Can’t figure out where the away3d.js bits should be for the examples? tag:away3d.com,2015:forum/viewthread/.5818 2015-03-13T20:19:55Z 0 Mr Margaret Scratcher I previously had the examples working, by following the tutorial here:

http://away3d.com/tutorials/Away3D_TypeScript_-_Getting_Started

But now I can’t seem to do it.

I get:

Cannot compile external modules unless the ‘—module’ flag is provided.

Which makes sense to me, as I can’t see that the awayjs bits are included anywhere…

What am I missing?

]]>
Examples don’t compile tag:away3d.com,2014:forum/viewthread/.5707 2014-10-28T22:50:39Z 0 Hammmer Hello

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.
https://github.com/awayjs/awayjs-examples

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.

Thanks for any information.

]]>