简体   繁体   English

(Flash CS5.5)Away3D基本设置帮助

[英](Flash CS5.5) Basic Away3D setup help

I've got Flash CS5.5, and I wanted to fiddle around with some 3D, so I downloaded Away3D from the website, and don't really know how to get it 'working' with CS5.5? 我已经安装了Flash CS5.5,并且想摆弄一些3D,所以我从网站上下载了Away3D,却真的不知道如何使其与CS5.5一起使用?

Can I just place the folder with my .fla files? 我可以只将文件夹与.fla文件放在一起吗? Or do I have to setup a actionscript path of some sort? 还是我必须设置某种动作脚本路径?

Also can someone give me a snippet to verify away3d works, as i've tried the following code: 也有人可以给我一个片段来验证away3d的作品,因为我尝试了以下代码:

package
{
    import away3d.containers.View3D;
    import away3d.primitives.Sphere;
    import flash.display.Sprite;

    [SWF(width="500", height="400", frameRate="60", backgroundColor="#FFFFFF")]
    public class physicas extends Sprite
    {
        public function physicas()
        {
            // create a viewport
            var View:View3D = new View3D({x:250,y:200});
            addChild(View);

            // create a sphere and put it on the 3D stage
            var sphere:Sphere = new Sphere();
            View.scene.addChild(sphere);

            // render the view
            View.render();
        }
    }
}

And I keep getting the output error message: 而且我不断收到输出错误消息:

1118: Implicit coercion of a value with static type Object to a possibly unrelated type away3d.containers:Scene3D.

What does this mean? 这是什么意思?

Thanks alot. 非常感谢。

The constructor for the View3D class takes a Scene3D object. View3D类的构造函数采用Scene3D对象。 Change 更改

var View:View3D = new View3D({x:250,y:200});

to

var scene1:Scene3D = new Scene3D(); 
var View:View3D = new View3D(scene1);

You also need to import the Scene3D class. 您还需要导入Scene3D类。

import away3d.containers.Scene3D;

You can find the docs here . 您可以在此处找到文档。

Here's a short tutorial on the topic of creating a Away3D scene: http://www.adobe.com/devnet/flashplayer/articles/creating-games-away3d.html 这是有关创建Away3D场景的简短教程: http : //www.adobe.com/devnet/flashplayer/articles/creating-games-away3d.html

It's on Flash Builder but the code is he same both for flash and flash-builder the difference is just where you put your imports. 它在Flash Builder上,但是Flash和Flash-Builder的代码相同,不同之处仅在于您将导入内容放在哪里。 If you don't know about that just edit the publish preferences under the actionscript settings. 如果您不知道这些,只需在动作脚本设置下编辑发布首​​选项。

Cheers! 干杯!

We just need to import the class to our fla files using the code 我们只需要使用代码将类导入到fla文件中即可

import [foldername]/.../[className];

... to make our flash file optimize, import only the class needed. ...为了使我们的Flash文件最优化,请仅导入所需的类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM