# Sending a variable to another mc?!

**URL:** <https://forum.kirupa.com/t/sending-a-variable-to-another-mc/274993>\
**Category:** flash\
**Created:** [November 7, 2008, 1:26pm UTC](https://forum.kirupa.com/t/sending-a-variable-to-another-mc/274993 "2008-11-07T13:26:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Surekin](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Surekin](https://forum.kirupa.com/u/Surekin)\
**Post date:** [November 7, 2008, 1:26pm UTC](https://forum.kirupa.com/t/sending-a-variable-to-another-mc/274993/1 "2008-11-07T13:26:32Z")

</div>

Hey Guys,

what i’m trying to do, is dynamicly loading in some XML Data from a Mysql Db and displaying it in table rows… works fine right now! But now i want to include a button which contains a link to a details page where more info can be found whatever. My Problem is to get the Id dynamicly into the Button. Currently i’m having a hidden textbox in the button which i fill with the dynamic ID, and on click read out this textbox to get the right ID. But…

Is there any way i can assign a special variable to this button, which i can read out later on? i don’t want this hidden textbox thingy…

hope someone understands what i mean…

the current code of the circle: (Comments are in german, sorry)

```auto

for (var i:int = 0; i < eventCount; i++) {  
  //Neue Row erzeugen
  var newEntry:mc_table = new mc_table();
 
  //Datum
  newEntry.txt_date.htmlText = eventInput.event.datum.text()*;
  //Uhrzeit
  newEntry.txt_time.htmlText = eventInput.event.zeit.text()*;
  //Firma
  newEntry.btn_firma.txt_firma.htmlText = eventInput.event.firma.text()*;
  //Locations
  //Pax
  newEntry.txt_pax.htmlText = eventInput.event.pax.text()*;
  //Status
  newEntry.txt_status.htmlText = eventInput.event.status.text()*;
  // X & Y definieren
  newEntry.y = y_old + 22;
  y_old = newEntry.y;
  //Name vergeben
  newEntry.name = "entry"+i;
  newEntry.id = i;
  addChild(newEntry);
 
  //Listener hinzufügen
  newEntry.btn_detail.addEventListener( MouseEvent.CLICK, clickBtn);
  newEntry.btn_firma.addEventListener( MouseEvent.CLICK, clickBtn);
 
 
 
  //ID
  var eventID:Number = eventInput.event.id.text()*;
  //EventId in die Row übergeben
  newEntry.btn_detail.txt_detail.text = eventID;
 
  //Detail Button Funktion
  function clickBtn(event:MouseEvent):void {
  //link aus der Textbox auslesen
  var showEventId = event.target.txt_detail.text;
  //Mach was mit der ID
  txt_info.htmlText = showEventId;
  //trace();
  }

```

Thx in advance
