why dont you just use a bitmap with a 1px border and apply that.. ie
create your texture and then add the border of your choice in Fireworks
or Photoshop or illustrator
and then use the bitmapmaterial to apply it to your plane.
It is surprisingly effective, and you get bit more control on the style
of the border..
hth
Pierre
serj wrote:
hello all
I try to add a dashed border around Plane object by setting outline
property, but things are not as I expect to be. Here is my code.
thanks
package test{
import away3d.containers.*;
import away3d.primitives.*;
import away3d.events.*;
import away3d.materials.*;
import flash.events.*;
import flash.text.*;
import mx.core.*;
public class TestingAway3d extends UIComponent{
private var view:View3D;
private var label1:TextField;
public function TestingAway3d(){
label1 = new TextField();
label1.defaultTextFormat = new TextFormat("Verdana", 12,
0xFFFFFF,false);
label1.x = 10;
label1.y = 10;
label1.width = 150;
label1.height = 30;
addChild(label1);
}
override protected function createChildren():void{
super.createChildren();
createView();
this.addEventListener(Event.ENTER_FRAME,update);
}
private function createView():void{
view = new View3D({x:200,y:200});
addChild(view);
var cell:Plane = new
Plane({material:"green#green",width:200,height:
200});
cell.addOnMouseOver(mouseOverCell);
cell.addOnMouseOut(mouseOutCell);
cell.rotationX = 90;
view.scene.addChild(cell);
}
public function update(e:Event):void{
if(view && this.view.stage){
view.render();
}
}
private function mouseOverCell(event:MouseEvent3D):void{
var obj:* = event.currentTarget;
if(obj is Plane){
var p:Plane = obj;
p.outline = new
WireframeMaterial("red",{width:2});//<--
nothing happen
label1.text = "MOUSE OVER";
}
}
private function mouseOutCell(event:MouseEvent3D):void{
var obj:* = event.currentTarget;
if(obj is Plane){
label1.text = "MOUSE OUT";
}
}
}
}