Implicit coercion of a value of type __AS3__.vec:Vector to an unrelated type __AS3__.vec:Vector.<int
i have following code:
i error:
scene 1, layer 'layer 1', frame 1, line 35 | 1067: implicit coercion of value of type __as3__.vec:vector unrelated type __as3__.vec:vector.<int>. |
import flash.display.shape;
import flash.events.mouseevent;
import flash.events.event;
var g:shape=new shape();
var stagecenterx:number=stage.stagewidth/2;
var stagecentery:number=stage.stageheight/2;
var radius:number=50;
var circumf:number=math.pi*2;
circumf=0;
var degrees:number=360;
g.graphics.linestyle(2,0xcc0000);
addchild(g);
g.graphics.moveto(stagecenterx, stagecentery+radius);
btn.addeventlistener(mouseevent.click, onbtnclick);
function onbtnclick(e:mouseevent):void{
addeventlistener(event.enter_frame, onenterframeevent);
}
function onenterframeevent(e:event):void{
circumf+=.1;
var vectorcommands:vector=new vector.<int>;//(360, true);
(var vcmd:int=0;vcmd<360; vcmd++){
vectorcommands.push(vcmd);
}
var vectorargs:vector=new vector.<number>;//(720, true);
(var vargs:int=0; vargs<720; vargs++){
vectorargs.push(math.sin(vargs/degrees)*radius);
vectorargs.push(math.cos(vargs/degrees)*radius);
}
(var i:int=0; i<degrees*circumf; i++){
//g.graphics.lineto(math.sin(i/degrees)*radius+stagecenterx,math.cos(i/degrees)*radius+st agecentery);
g.graphics.drawpath(vectorcommands,vectorargs); //// line error
}
}
the question is, how push vectors? more familiar arrays drawpath method uses vectors.
var vectorcommands:vector.<int> = new vector.<int>();
var vectorargs:vector.<number> = new vector.<number>();
More discussions in ActionScript 3
adobe
Comments
Post a Comment