# \[FMX\] calling properties of other objects

**URL:** <https://forum.kirupa.com/t/fmx-calling-properties-of-other-objects/164792>\
**Category:** flash\
**Created:** [October 4, 2005, 9:51pm UTC](https://forum.kirupa.com/t/fmx-calling-properties-of-other-objects/164792 "2005-10-04T21:51:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dael77](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dael77](https://forum.kirupa.com/u/dael77)\
**Post date:** [October 4, 2005, 9:51pm UTC](https://forum.kirupa.com/t/fmx-calling-properties-of-other-objects/164792/1 "2005-10-04T21:51:33Z")

</div>

Ok, here the code that I have

//Object 1  
function object1() {  
this.txt = “It works!”;  
}  
object1.prototype = new MovieClip();  
Object.registerClass(“object1”, object1);

//Object 2  
function object2() {  
}  
object2.prototype = new MovieClip();  
object2.prototype.onEnterFrame = function() {  
trace(object1.txt);  
}  
Object.registerClass(“object2”, object2);

attachMovie(“object1”,“object1”,1);  
attachMovie(“object2”,“object2”,2);

Now when I add the objects, im getting “undefined” for the value of object1.txt, and I have no idea what else to do =.  
Thanks in advance for any help.
