-
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);