# Actions for attachMovie items

**URL:** <https://forum.kirupa.com/t/actions-for-attachmovie-items/274926>\
**Category:** flash\
**Created:** [November 6, 2008, 5:09pm UTC](https://forum.kirupa.com/t/actions-for-attachmovie-items/274926 "2008-11-06T17:09:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![boptilyadrop55](https://avatars.discourse-cdn.com/v4/letter/b/8491ac/32.png) [@boptilyadrop55](https://forum.kirupa.com/u/boptilyadrop55)\
**Post date:** [November 6, 2008, 5:09pm UTC](https://forum.kirupa.com/t/actions-for-attachmovie-items/274926/1 "2008-11-06T17:09:49Z")

</div>

Hi all, I hope somebody can help me with this - I have a menu that dynamically generates Buttons.

The Code for this is

```auto
function attachMenu() {
for (i=0; i<rubrieken.length; i++) {
 blockItem = followMenu.blockHolder.attachMovie("block", "block"+i, 1000+i);
 blockItem._href = rubrieken*.attributes.href;
 blockItem.contentT = rubrieken*.attributes.naam;

```

This works perfectly. Then actions for the buttons are attached with:

```auto
blockItem.onRelease = function():Void {
  getURL(this._href, "_blank");
  trace(this._href);
 };

```

and the entries for that come from XML:

```auto
<rubriekenxml>
    <project naam="LABELNAME 1" image="" href=http://www.something.com/>
  <project naam="LABELNAME 2" image="" href="[[COLOR=#0066cc]http://www.something.com[/COLOR]](http://www.something.com/)"/>
  <project naam="LABELNAME 3" image="" href="[[COLOR=#0066cc]http://www.something.com[/COLOR]](http://www.something.com/)"/>
</rubriekenxml>

```

Works, too. Now I’m trying to submit different actions for the Buttons. Button 1 is supposed to open a website (like it does), while all other buttons should load an external SWF with loadMovieNum(this.\_href, 30);

So can anybody help me with this - I don’t know how to build a loop like

for button number 1 --\> getURL(this.\_href, “\_blank”);  
for button number 2,3,4,5,6 --\> loadMovieNum(this.\_href, 30);

Thanks for your help!

B
