# Simple: Should be working; can't find error

**URL:** <https://forum.kirupa.com/t/simple-should-be-working-cant-find-error/324476>\
**Category:** flash\
**Created:** [August 23, 2011, 1:26am UTC](https://forum.kirupa.com/t/simple-should-be-working-cant-find-error/324476 "2011-08-23T01:26:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rassy7](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@rassy7](https://forum.kirupa.com/u/rassy7)\
**Post date:** [August 23, 2011, 1:26am UTC](https://forum.kirupa.com/t/simple-should-be-working-cant-find-error/324476/1 "2011-08-23T01:26:38Z")

</div>

- I have a flash project called contact

- The document class is ContactClass

I am trying to make a sprite button with graphics and can’t make it work. I have successfully added text fields so I know the path is correct. I suspected my code was correct and confirmed it should be, after reading several tutorials showing the process for creating sprite buttons with graphics. Anyway, I imported nearly every class on Earth, but certainly everything which needs to be. Stage is gray and 800x600.

The graphics code by itself with appear, but not when linked to the sprite. Also, the sprite won’t appear no matter what. Another interesting piece of the puzzle: nothing will trace, not even objects such as textfields which actually appear and function on the stage when I text the code. Here’s the code in question. Can you see any problem.

Thanks,

~Josh

public class ContactClass extends Sprite {  
public function ContactClass() {

var home\_btn:Sprite = new Sprite();  
home\_btn.graphics.lineStyle(2);  
home\_btn.graphics.beginFill(0x000000);  
home\_btn.graphics.drawRoundRect(147, 556, 100, 22, 10, 10);  
home\_btn.graphics.endFill();  
home\_btn.x = 147;  
home\_btn.y = 556;  
home\_btn.width = 100;  
home\_btn.height = 22;  
home\_btn.buttonMode = true;  
home\_btn.addEventListener(MouseEvent.CLICK, onHomeClick);  
addChild(home\_btn);
