How to draw lines dynamically?
hello,
i have problem drawing lines connected dots.
thats not working ... statement moveto undefined? has idea whats wrong?
ive posted code you...
thanks lot replay!
i have problem drawing lines connected dots.
thats not working ... statement moveto undefined? has idea whats wrong?
ive posted code you...
thanks lot replay!
hi grauzone,
believe "moveto" undefined because clip targetting
undefined. trace this[linie+i] , see if it's movie clip instance.
think you'll find answer there.
regards,
patrick bay
bay new media
"grauzone" <webforumsuser@macromedia.com> wrote in message
news:fnd081$g1b$1@forums.macromedia.com...
> hello,
>
> have problem drawing lines connected dots.
>
> thats not working ... statement moveto undefined? has
> idea
> whats wrong?
>
> ive posted code you...
>
> lot replay!
>
>
>
>
> var data:array = new array(2.3,5.1,3.4,2.7);
>
>
>
> function init(kreis:string, linie:string, colorline, colordot,
> darray:array) {
> var total = darray.length;
> (var i:number = 0; i<total; i++) {
> this.createemptymovieclip(linie+i, this.getnexthighestdepth());
> this.attachmovie("punkt", kreis+i, this.getnexthighestdepth());
> var mc:movieclip = this[kreis+""+i];
> var my_color:color = new color(mc);
> my_color.setrgb(colordot);
> mc._x = (52*i)+54;
> mc._y = 375-(darray *4);
>
> this[linie+i].clear();
> this[linie+i].linestyle(3, 0xffd836);
> this[linie+i].moveto(this[kreis+(i+1)]._x, this[kreis+(i+1)]._y);
> this[linie+i].lineto(this[kreis+i]._x, this[kreis+i]._y);
>
> }
> }
>
> init("dot", "line", 0xffec9b, 0xffd836, data);
>
believe "moveto" undefined because clip targetting
undefined. trace this[linie+i] , see if it's movie clip instance.
think you'll find answer there.
regards,
patrick bay
bay new media
"grauzone" <webforumsuser@macromedia.com> wrote in message
news:fnd081$g1b$1@forums.macromedia.com...
> hello,
>
> have problem drawing lines connected dots.
>
> thats not working ... statement moveto undefined? has
> idea
> whats wrong?
>
> ive posted code you...
>
> lot replay!
>
>
>
>
> var data:array = new array(2.3,5.1,3.4,2.7);
>
>
>
> function init(kreis:string, linie:string, colorline, colordot,
> darray:array) {
> var total = darray.length;
> (var i:number = 0; i<total; i++) {
> this.createemptymovieclip(linie+i, this.getnexthighestdepth());
> this.attachmovie("punkt", kreis+i, this.getnexthighestdepth());
> var mc:movieclip = this[kreis+""+i];
> var my_color:color = new color(mc);
> my_color.setrgb(colordot);
> mc._x = (52*i)+54;
> mc._y = 375-(darray *4);
>
> this[linie+i].clear();
> this[linie+i].linestyle(3, 0xffd836);
> this[linie+i].moveto(this[kreis+(i+1)]._x, this[kreis+(i+1)]._y);
> this[linie+i].lineto(this[kreis+i]._x, this[kreis+i]._y);
>
> }
> }
>
> init("dot", "line", 0xffec9b, 0xffd836, data);
>
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment