A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: changing line thickness?

  1. #1
    Member
    Join Date
    Sep 2014
    Posts
    75

    changing line thickness?

    Hello All,

    for the following code as an example;

    this.createEmptyMovieClip("triangle_mc", 1);
    triangle_mc.lineStyle(5, 0xFF00FF, 100);
    triangle_mc.moveTo(200, 200);
    triangle_mc.lineTo(300, 300);
    triangle_mc.lineTo(100, 300);
    triangle_mc.lineTo(200, 200);

    If the thickness of line(sides of the triangle here) is to be changed, e.g. 10 instead of 5; is there any way to do that, in AS2.0, without having to use the "lineStyl()" and re-drawing the triangle again?

    Thanks for your time!

    Regards

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Apparently not from what I was reading earlier, can't find the page again to show you.

    but you can do it with a loop sort of thing, ish.

    PHP Code:
    var arg:Number 1;

    lineSize();

    function 
    lineSize():Void
    {
        
    trace(arg);

        
    this.createEmptyMovieClip("triangle_mc",1);

        
    triangle_mc.lineStyle(arg,0xFF00FF,100);
        
    triangle_mc.moveTo(200,200);
        
    triangle_mc.lineTo(300,300);
        
    triangle_mc.lineTo(100,300);
        
    triangle_mc.lineTo(200,200);

        
    arg += 1;

        if (
    arg 15)
        {
            
    clearInterval(continual);
        }
    }

    var 
    continual:Number setInterval(lineSize1000); 

  3. #3
    Member
    Join Date
    Sep 2014
    Posts
    75
    Thank you!

    //
    DrawTriangle(10, "0xFF00FF", 100);
    //
    function DrawTriangle(thickness:Number, colour:String, alpha:Number):Void {
    this.createEmptyMovieClip("triangle_mc", 1);
    triangle_mc.lineStyle(thickness, colour, alpha);
    triangle_mc.moveTo(200, 200);
    triangle_mc.lineTo(300, 300);
    triangle_mc.lineTo(100, 300);
    triangle_mc.lineTo(200, 200);
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center