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

发布于 2024-12-17 04:39:55 字数 1023 浏览 3 评论 0原文

我有 Flash CS5.5,我想摆弄一些 3D,所以我从网站下载了 Away3D,但真的不知道如何让它与 CS5.5 一起“工作”?

我可以只将该文件夹与 .fla 文件放在一起吗?或者我是否必须设置某种动作脚本路径?

另外有人可以给我一个片段来验证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();
        }
    }
}

并且我不断收到输出错误消息:

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

这是什么意思?

多谢。

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?

Can I just place the folder with my .fla files? 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:

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

温柔嚣张 2024-12-24 04:39:55

View3D 类的构造函数采用 Scene3D 对象。更改

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

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

您还需要导入 Scene3D 类。

import away3d.containers.Scene3D;

您可以在此处找到文档。

The constructor for the View3D class takes a Scene3D object. 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.

import away3d.containers.Scene3D;

You can find the docs here.

桃扇骨 2024-12-24 04:39:55

以下是有关创建 Away3D 场景主题的简短教程:
http://www.adobe.com/devnet/flashplayer/articles /creating-games-away3d.html

它位于 Flash Builder 上,但 flash 和 flash-builder 的代码是相同的,区别只是导入的位置不同。如果您不知道,只需编辑动作脚本设置下的发布首选项即可。

干杯!

Here's a short tutorial on the topic of creating a Away3D scene:
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. If you don't know about that just edit the publish preferences under the actionscript settings.

Cheers!

忆梦 2024-12-24 04:39:55

我们只需使用代码将该类导入到我们的 fla 文件中

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

......
为了使我们的 Flash 文件得到优化,只需导入所需的类。

We just need to import the class to our fla files using the code

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

...
to make our flash file optimize, import only the class needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文