# Attach movie clip to class?

**URL:** <https://forum.kirupa.com/t/attach-movie-clip-to-class/30305>\
**Category:** Uncategorized\
**Created:** [September 6, 2003, 9:52pm UTC](https://forum.kirupa.com/t/attach-movie-clip-to-class/30305 "2003-09-06T21:52:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpn](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jpn](https://forum.kirupa.com/u/jpn)\
**Post date:** [September 6, 2003, 9:52pm UTC](https://forum.kirupa.com/t/attach-movie-clip-to-class/30305/1 "2003-09-06T21:52:08Z")

</div>

Can someone help me attach a button movie clip to class?

[AS]

function Job(id) {  
this.id = id;  
this.jobName = \_root.loginData[“btnJob”+id+"\_name"];  
this.jobID = \_root.loginData[“btnJob”+id+"\_id"]; // the job id for interaction w/ php  
this.hasSales = \_root.loginData[“btnJob”+id+"\_hasSales"]; // if they’re an employee who processes sales  
}

function JobButton(id) {  
this.job = new Job(id);  
}

JobButton.prototype = new MovieClip();  
Object.registerClass(“movJobButton”, JobButton);

// this code lives in another clip…  
for(x=0; x \< \_root.employee.numJobs; x++) {

\_root[“jobButton”+(x+1)] = new \_root.JobButton(x+1);  
\_root[“jobButton”+(x+1)].attachMovie(“jobButton”, “myJobButton”+(x+1), (x+1));

}  
[/AS]

While debugging, I see that jobButton1 is:  
Variable \_level0.jobButton1 = [object #71, class ‘MovieClip’] {  
job:[object #72, class ‘Job’] {  
jobName:“Maintenance”,  
jobID:“1”,  
hasSales:“0”  
}  
}

but the movie clip isn’t showing up on the stage… I’m new at oop, anyone know what I’m doing wrong?

Thanks!
