A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: How to get lines BEING DRAWN ?

  1. #1
    Junior Member
    Join Date
    Jan 2002
    Posts
    9
    I want a rectangular being drawn at my site, I mean the visitor should see that the lines are drawn (becoming longer, takuing a corner of 90 degrees etc.). I'm completely new to SWish. Is there anyone who could give me a hand ?
    Kippie

  2. #2
    ? tonytryout's Avatar
    Join Date
    Oct 2001
    Location
    Somewhere out there
    Posts
    864
    I am not an expert but you could try using a mask facility in Flash.

    If you are using Flash:
    a) draw a small box that is the same colour as the background. It should use its own layer.
    b) draw a rectangle in another layer.
    c) create motion line (or something, I forgot) under the layer of the mask box. Draw this "line" around the rectangle.
    d) set the start point and end point of where the mask box should start from and ends.
    e) the result is that it gives an impression that a rectangle is being drawn.

    If you are using Swish -- I have not seen a screenshot of the program let alone the program itself! =]

    If anyone else thinks that this suggestion is not feasible, or there is a better way -- tell all!

  3. #3
    SWiSHer extraordinaire
    Join Date
    Dec 2000
    Location
    Australia
    Posts
    3,900
    In SWiSH you can use the same method as described for Flash.

    I've got a SWiSH example which does (similar to) this by motion-tweening the lines from 0 length to desired length (in this case it doesn't draw the rectangle but does sides and a diagonal .. which is a little trickier really).

    There is a thread in the SWiSH Help forum (where you probably should ask this sort of question anyway) .. have to do a search to find it

    http://members.dingoblue.net.au/~rog...Draw-Lines.swi
    http://members.dingoblue.net.au/~rog...Draw-Lines.swf

  4. #4
    Junior Member
    Join Date
    Jan 2002
    Posts
    24

    lines

    Go to designs by mark they have a good tut on this.

  5. #5
    SWiSHer extraordinaire
    Join Date
    Dec 2000
    Location
    Australia
    Posts
    3,900
    What is the URL for that ??

    Is it a tut for SWiSH (as the poster asked for) ??

  6. #6
    Junior Member
    Join Date
    Jan 2002
    Posts
    24

  7. #7
    SWiSHer extraordinaire
    Join Date
    Dec 2000
    Location
    Australia
    Posts
    3,900
    Yeup .. same method as one can use in SWiSH .. details are a little different.

    Drawing the two rectangles (one line, other solid) and rotating and resizing on of them would all be pretty much the same.

    Adding motion to the rectangle is similar .. only you'd double-click on the timeline for the rectnalge to create the motion tween.

    For masking, you'd place the larger rectangle BELOW the line rectangle, select them both and group as a sprite, then change the sprite to be masked.

    Most techniques the you'd use in Flash that don't involve action-scripting will work in the same way with SWiSH .. even a few of the scripting examples do to.

  8. #8
    Junior Member
    Join Date
    Jan 2002
    Posts
    9
    Thanks everyone
    Kippie

    Originally posted by roger_onslow
    Yeup .. same method as one can use in SWiSH .. details are a little different.

    Drawing the two rectangles (one line, other solid) and rotating and resizing on of them would all be pretty much the same.

    Adding motion to the rectangle is similar .. only you'd double-click on the timeline for the rectnalge to create the motion tween.

    For masking, you'd place the larger rectangle BELOW the line rectangle, select them both and group as a sprite, then change the sprite to be masked.

    Most techniques the you'd use in Flash that don't involve action-scripting will work in the same way with SWiSH .. even a few of the scripting examples do to.

  9. #9
    devonair
    Guest
    my personal preference: use a mask. draw the rectangle and have a mask move over it in the way you want to show it being drawn. May have to customize the shape of the mask to make it look right, but it's a good effect.

  10. #10
    Senior Member
    Join Date
    Mar 2001
    Posts
    201
    i agree with devon masks are the easiest way to do it.

  11. #11
    SWiSHer extraordinaire
    Join Date
    Dec 2000
    Location
    Australia
    Posts
    3,900
    Masking can give you a nice effect .. but it is quite limited in the way in which the line appear (eg. you end up with it drawing in to directions at once with varying speeds). It also gets tricky with shapes that are less simply then individual single lines (for which masking works well) or rectangles. Howevre, the masking DOES work well for shapes with non-straight lines.

    To get the look of the lines being drawn, in order, then individually tweening each line is the best way to get the "correct" look. And it is no more difficult to achieve (probably a little less complex as there is only one line shape for each line .. no mask object)

    It really depends on how you want things to look (how fussy you are) ... both techniques are very easy to use.


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