# Need some help(newbie)

**URL:** <https://forum.kirupa.com/t/need-some-help-newbie/29005>\
**Category:** flash\
**Created:** [August 21, 2003, 1:01am UTC](https://forum.kirupa.com/t/need-some-help-newbie/29005 "2003-08-21T01:01:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![beertents](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@beertents](https://forum.kirupa.com/u/beertents)\
**Post date:** [August 21, 2003, 1:01am UTC](https://forum.kirupa.com/t/need-some-help-newbie/29005/1 "2003-08-21T01:01:11Z")

</div>

I have a clip of a bird flying across the screen. I found a script on the web that would give me random starts across the screen. but it seems not to work that well. Is there a simple script that can acheive the effect of the bird flying randomly across the screen?  
Any help would be greatly appreciated. TIA:D

---

<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:** [August 21, 2003, 1:27am UTC](https://forum.kirupa.com/t/need-some-help-newbie/29005/2 "2003-08-21T01:27:08Z")

</div>

Place the following code on the movie clip:[AS]onClipEvent (load) {  
initx = 0-\_width;  
stagex = 550;  
stagey = 400;  
speed = Math.random()\*2+1;  
\_x = initx;  
}  
onClipEvent (enterFrame) {  
if (\_x\>stagex) {  
\_x = initx;  
\_y = Math.random()\*stagey;  
speed = Math.random()\*2+1;  
} else {  
\_x += speed;  
}  
}[/AS]I suggest a frame rate of 25.

---

<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:** [August 21, 2003, 2:11am UTC](https://forum.kirupa.com/t/need-some-help-newbie/29005/3 "2003-08-21T02:11:08Z")

</div>

Thanx for the script it is much better as i used to have a tween of the bird flying across and now this seems much nicer. Just one hopefully minor detail. I need the bird to stay at the top half of the page. Is this at all possible. Much appreciated claudio!!

---

<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:** [August 21, 2003, 2:13am UTC](https://forum.kirupa.com/t/need-some-help-newbie/29005/4 "2003-08-21T02:13:48Z")

</div>

As you wish… ;)[AS]onClipEvent (load) {  
initx = 0-\_width;  
inity = Math.random()\*200;  
stagex = 550;  
stagey = 200;  
speed = Math.random()\*2+1;  
\_x = initx;  
\_y = inity;  
}  
onClipEvent (enterFrame) {  
if (\_x\>stagex) {  
\_x = initx;  
\_y = Math.random()\*stagey;  
speed = Math.random()\*2+1;  
} else {  
\_x += speed;  
}  
}[/AS]

---

<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:** [August 21, 2003, 2:42am UTC](https://forum.kirupa.com/t/need-some-help-newbie/29005/5 "2003-08-21T02:42:20Z")

</div>

Your help is greatly appreciated but that didnt seem to work.  
Umm. I have some great ideas but cant seem to get the hang of the scripts. I notice 1 change from the previous script.

---

<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:** [August 21, 2003, 2:49am UTC](https://forum.kirupa.com/t/need-some-help-newbie/29005/6 "2003-08-21T02:49:29Z")

</div>

That do works :-\

---

<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:** [August 21, 2003, 2:54am UTC](https://forum.kirupa.com/t/need-some-help-newbie/29005/7 "2003-08-21T02:54:31Z")

</div>

Yes sorry you are right!!! I wasnt clear, my movie is only 550X300. I changed the code to reflect the difference in my movie and it works very well now!!! Thank You!!! Thank You!!

---

<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:** [August 21, 2003, 2:56am UTC](https://forum.kirupa.com/t/need-some-help-newbie/29005/8 "2003-08-21T02:56:13Z")

</div>

Ahh i knew  
Anytime =)
