# Help needed, adding a function to a movie clip

**URL:** <https://forum.kirupa.com/t/help-needed-adding-a-function-to-a-movie-clip/1829>\
**Category:** flash\
**Created:** [May 16, 2002, 9:24am UTC](https://forum.kirupa.com/t/help-needed-adding-a-function-to-a-movie-clip/1829 "2002-05-16T09:24:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 16, 2002, 9:24am UTC](https://forum.kirupa.com/t/help-needed-adding-a-function-to-a-movie-clip/1829/1 "2002-05-16T09:24:19Z")

</div>

hi, i am new to flash so my question might be simple but for me its very important to get the answer quickly,  
now here is what i am trying to do.  
i want to add a flashing text to my scene( triggerred on an event) for that i want to make a movie clip in which i am displaying a text from frame 1 to 5 and looping back to 1 on frame 5 so it displays “1” all the time , then from frame 6 to 8 i am displayint the “1” character and than from 8 to 10 the frame display nothing so basically when frame 6 to 10 is running it gives a blinking effect.  
now i want to write two funtions to call ( using gotoandplay)frame 1 and frame 6 so that i can controll when to flash that “1” charactor and when to display it .  
i want to have multiple instances of this movie clip in my scene.  
can any one help me with that telling me where to define /declare these function and how to call them .  
thanks  
Yahya

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 16, 2002, 9:43am UTC](https://forum.kirupa.com/t/help-needed-adding-a-function-to-a-movie-clip/1829/2 "2002-05-16T09:43:15Z")

</div>

Well you don’t need to loop from 1 to 5 first off.

Create the movie clip with whatever text you want it to display normaly, without blinking in frame 1. Then from frame 2 to 4 have the text displayed, and from 5 to 7 have no text displayed.

create a new blank layer in this movie clip.

on frame 1 of the new layer, place a stop(); action.  
on frame 7 place a gotoAndPlay(2); action

now for this example, I’m using an instance name of “myMovieClip” for this movie clip.

When you want it to be normal you call  
myMovieClip.gotoAndStop(1);  
when you want it to be blinking you call  
myMovieClip.gotoAndPlay(2);
