(Flash CS5.5) 基本 Away3D 设置帮助
我有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
View3D 类的构造函数采用 Scene3D 对象。更改
为
您还需要导入 Scene3D 类。
您可以在此处找到文档。
The constructor for the View3D class takes a Scene3D object. Change
to
You also need to import the Scene3D class.
You can find the docs here.
以下是有关创建 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!
我们只需使用代码将该类导入到我们的 fla 文件中
......
为了使我们的 Flash 文件得到优化,只需导入所需的类。
We just need to import the class to our fla files using the code
...
to make our flash file optimize, import only the class needed.