When swf file is opened directly, 3d view doesn’t work, check this out:
away3d . atspace . co . uk / test.html
away3d . atspace . co . uk / test.swf
First link works ok, displays sign Test and yellow sphere, second displays only sign Test, without sphere and view backgroud.
Locally it works ok, both .swf and .html (you can download swf and check on your computer).
away3d . atspace . co . uk / test.rar
Does anybody experienced such problem and know how to solve it?
PS: i cannot publish links, it also doesn’t work on that forum
I get error info
Computer says your input might be spam, so it is discarded.
code:
package
{
import away3d.containers.View3D;
import away3d.core.base.*;
import away3d.core.render.*;
import away3d.materials.*;
import away3d.primitives.*;
import flash.display.Sprite;
import flash.events.Event;
import flash.system.*;
import flash.text.TextField;
import flash.utils.*;
[SWF(width="100", height="100", frameRate="60")]
public class test extends Sprite
{
private var view : View3D;
private var out:TextField;
private function onEnterFrame(ev:Event) : void
{
view.render();
}
public function test()
{
view = new View3D();
view.backgroundColor = 0xff6666;
view.visible=true;
//view.renderer.swapBackBuffer=true;
this.addChild(view);
var material:ColorMaterial=new ColorMaterial(0xccaa00);
var sphere:Sphere = new Sphere(material,900,15,25);
sphere.z=1250;
//sphere.bothsides=false;
view.scene.addChild(sphere);
view.render();
out = new TextField();
this.addChild(out);
out.text='Test';
out.x=0;
out.y=0;
out.textColor=0x000000;
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
}
}