# Dot Animation - Probably Complex Script

**URL:** <https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877>\
**Category:** flash\
**Created:** [March 22, 2006, 4:45am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877 "2006-03-22T04:45:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maive](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Maive](https://forum.kirupa.com/u/Maive)\
**Post date:** [March 22, 2006, 4:45am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/1 "2006-03-22T04:45:31Z")

</div>

[FONT=“Times New Roman”][COLOR=“DarkSlateBlue”][COLOR=“darkslateblue”][COLOR=“darkslateblue”]Hello:

How do I go about animating a dot to trace the contour lines of a shape, leaving a line path as it goes along? I have the final shape, which is a complex shape, like the shape of a land when you look at a map. For the animation, I was hoping that I can start off with an empty document, and the contour line will begin to trace itself until the final shape appears.

Thanks, :cantlook:[/COLOR][/COLOR][/COLOR][/FONT]

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 22, 2006, 7:35am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/2 "2006-03-22T07:35:05Z")

</div>

> [@Maive](#):
>
> [FONT=Times New Roman][COLOR=darkslateblue][COLOR=darkslateblue][COLOR=darkslateblue]Hello:
> 
> How do I go about animating a dot to trace the contour lines of a shape, leaving a line path as it goes along? I have the final shape, which is a complex shape, like the shape of a land when you look at a map. For the animation, I was hoping that I can start off with an empty document, and the contour line will begin to trace itself until the final shape appears.
> 
> Thanks, :cantlook:[/COLOR][/COLOR][/COLOR][/FONT]

this is the easiest way but wether or not it suits your needs…  
all i did was create a guide layer and drew the shape. made the layer into a guide and then made a small ball instance. then tweened the “ball” to follow the shape. and then added this to the timeline.  
[AS]  
\_root.createEmptyMovieClip(“pen”,1)  
pen.lineStyle(2,0xE401AC,100)  
pen.moveTo(ball.\_x,ball.\_y)  
pen.onEnterFrame=function(){  
pen.lineTo(ball.\_x,ball.\_y)  
}  
[/AS]

its the simpliest way…

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 22, 2006, 7:35am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/3 "2006-03-22T07:35:39Z")

</div>

> [@Maive](#):
>
> [FONT=Times New Roman][COLOR=darkslateblue][COLOR=darkslateblue][COLOR=darkslateblue]Hello:
> 
> How do I go about animating a dot to trace the contour lines of a shape, leaving a line path as it goes along? I have the final shape, which is a complex shape, like the shape of a land when you look at a map. For the animation, I was hoping that I can start off with an empty document, and the contour line will begin to trace itself until the final shape appears.
> 
> Thanks, :cantlook:[/COLOR][/COLOR][/COLOR][/FONT]

this is the easiest way but wether or not it suits your needs…  
all i did was create a guide layer and drew the shape. made the layer into a guide and then made a small ball instance. then tweened the “ball” to follow the shape. and then added this to the timeline.  
[AS]  
\_root.createEmptyMovieClip(“pen”,1)  
pen.lineStyle(2,0xE401AC,100)  
pen.moveTo(ball.\_x,ball.\_y)  
pen.onEnterFrame=function(){  
pen.lineTo(ball.\_x,ball.\_y)  
}  
[/AS]

its the simpliest way…

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 22, 2006, 7:36am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/4 "2006-03-22T07:36:02Z")

</div>

> [@Maive](#):
>
> [FONT=Times New Roman][COLOR=darkslateblue][COLOR=darkslateblue][COLOR=darkslateblue]Hello:
> 
> How do I go about animating a dot to trace the contour lines of a shape, leaving a line path as it goes along? I have the final shape, which is a complex shape, like the shape of a land when you look at a map. For the animation, I was hoping that I can start off with an empty document, and the contour line will begin to trace itself until the final shape appears.
> 
> Thanks, :cantlook:[/COLOR][/COLOR][/COLOR][/FONT]

this is the easiest way but wether or not it suits your needs…  
all i did was create a guide layer and drew the shape. made the layer into a guide and then made a small ball instance. then tweened the “ball” to follow the shape. and then added this to the timeline.  
[AS]  
\_root.createEmptyMovieClip(“pen”,1)  
pen.lineStyle(2,0xE401AC,100)  
pen.moveTo(ball.\_x,ball.\_y)  
pen.onEnterFrame=function(){  
pen.lineTo(ball.\_x,ball.\_y)  
}  
[/AS]

its the simpliest way…

---

<div class="post-metadata">

**Author:** ![Maive](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Maive](https://forum.kirupa.com/u/Maive)\
**Post date:** [March 22, 2006, 9:12am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/5 "2006-03-22T09:12:46Z")

</div>

[FONT=“Times New Roman”][COLOR=“DarkSlateBlue”]Oh nice, thanks for supplying an SWF example! However, I’m not too sure what you mean by, “made the layer into a guide”… _lol_ sorry for the confusion, I’m not THAT advanced in dissecting every element of ActionScript.

All I have ready is a layer consisting of my already-drawn shape.

According to your script, I can see an empty MC is made called “pen.” And the rest are stating attributes of the pen. But I guess I just don’t see how it connects to the layer consisting of the final shape. :h:[/COLOR][/FONT]

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 22, 2006, 9:24am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/6 "2006-03-22T09:24:30Z")

</div>

hold on ill post you the .fla file!

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 22, 2006, 9:26am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/7 "2006-03-22T09:26:41Z")

</div>

here

---

<div class="post-metadata">

**Author:** ![Maive](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Maive](https://forum.kirupa.com/u/Maive)\
**Post date:** [March 22, 2006, 11:05pm UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/8 "2006-03-22T23:05:18Z")

</div>

> [@Macaroni Ted](#):
>
> here

[FONT=“Times New Roman”][COLOR=“DarkSlateBlue”]  
Hmmm… I tried opening it but a popup says: Unexpected file format.  
Huh…[/COLOR][/FONT]

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 23, 2006, 1:37am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/9 "2006-03-23T01:37:25Z")

</div>

> [@Maive](#):
>
> [FONT=Times New Roman][COLOR=darkslateblue]  
> Hmmm… I tried opening it but a popup says: Unexpected file format.  
> Huh…[/COLOR][/FONT]

sorry bout that… dont know what happened.  
1 i drew the pink shape  
2 then right clicked the layer and selected “guide”  
\*\*\* you can do this another was by first clicking “add Motion guide” and then on the new layer draw the shape u want.  
3 made the pink circle made an instance of it and named it “ball”  
\*\*\*\*make sure that the layer with the instance on is below the “motion path” layer.  
4. with the SNAP TO OBJECTS modifier for the arrows tool turned on, grab the ball instance by its REGISTRATION POINT, and place it where u like on the “motion Path” (it should snap on to it)  
5 added about 50 frames to each layer and inserted a keyframe to frame 50 of the ball instance layer  
6 on frame 50 moved the instance round the shape until about half way round  
7 added a motion tween between the 1 and 50th frame so the ball instance should then follow the Motion path half way round.  
8 added another 50 frames and another keyframe to make the instance go around to the start point. (you may need to play around with this bit to get it back use more keyframe to break up the rotation round the guild)  
9 so now the ball instance follows the motion path round. then added a new layer and in the first fame in the empty keyframe i added the code i first posted

so it uses the position and movement of the ball instance to draw the lines.  
it a simple method but it works.

---

<div class="post-metadata">

**Author:** ![Maive](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Maive](https://forum.kirupa.com/u/Maive)\
**Post date:** [March 23, 2006, 4:20am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/10 "2006-03-23T04:20:01Z")

</div>

[FONT=“Times New Roman”][COLOR=“DarkSlateBlue”]Wow! Thank you for the explanation and breakdown. It sure is a great method. Thanks Mr. M. Ted! You’ve been a great help! :thumb2:

Ehhhhh… ActionScript…! I’m just not a girl who speaks code. But I try! :P[/COLOR][/FONT]

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 23, 2006, 4:23am UTC](https://forum.kirupa.com/t/dot-animation-probably-complex-script/182877/11 "2006-03-23T04:23:57Z")

</div>

> [@Maive](#):
>
> [FONT=Times New Roman][COLOR=darkslateblue]Wow! Thank you for the explanation and breakdown. It sure is a great method. Thanks Mr. M. Ted! You’ve been a great help! :thumb2:
> 
> Ehhhhh… ActionScript…! I’m just not a girl who speaks code. But I try! :P[/COLOR][/FONT]

no problem 🍺
