# For loop, syntax error (easy)

**URL:** <https://forum.kirupa.com/t/for-loop-syntax-error-easy/188437>\
**Category:** flash\
**Created:** [May 7, 2006, 11:50pm UTC](https://forum.kirupa.com/t/for-loop-syntax-error-easy/188437 "2006-05-07T23:50:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iLikePie](https://avatars.discourse-cdn.com/v4/letter/i/85f322/32.png) [@iLikePie](https://forum.kirupa.com/u/iLikePie)\
**Post date:** [May 7, 2006, 11:50pm UTC](https://forum.kirupa.com/t/for-loop-syntax-error-easy/188437/1 "2006-05-07T23:50:17Z")

</div>

hey,

i know this is simple, but i just cant get it.

Basically i have an MC called ‘sfx’ to which i’m loading some sounds, because i thought yo’re meant to be able to access them from the library, but apparently not.

so here’s the code on the MC ‘sfx’

```auto
onClipEvent (load){
	for (a=1;a<6;a++){
		Trumpet[a]=new Sound(); 
		Trumpet[a].attachSound("Trumpet"+a);
}

```

Just to clarify, the sounds in the library have been exported for AS under the names Trumpet1, Trumpet2 etc.

and then i have a button where i want to be able to play one of the sounds, but its not working. I’ve been testing with a specific sound (i.e on the button)

\_root.sfx.Trumpet1.start();

but it just appears the sounds aren’t loading properly. So i figure there’s something wrong in the way i’ve syntaxed the loop, but i don’t kow… i have real trouble with [] and + and what to do when.

thanks!  
Stuart
