Skip to main content
Participant
August 13, 2007
Answered

Moving Created Buttons

  • August 13, 2007
  • 4 replies
  • 224 views
This works, but uses the default looking button:

var btn:Button = new Button();
btn.move(200,200);
addChild(btn);



This doesn't, with my pretty button:

var btn1:Button1 = new Button1();
btn1.move(200,200); // If I comment this line out, the button draws, but is in the upper left as expected
addChild(btn1);

The linkage for my created button has Button1 for the Class, and flash.display.SimpleButton for the default class.
This topic has been closed for replies.
Correct answer kglad
try:

4 replies

Participant
August 13, 2007
Thank you. The light is turning on...
kglad
Community Expert
Community Expert
August 13, 2007
you're welcome.
kglad
Community Expert
Community Expert
August 13, 2007
you're using code for a button component. components are compiled movieclips that can have their own custom properties and methods. so, you wouldn't expect your code to work for a member of the button class.

i'm using code for the button class which has its own properties and methods. you would expect the code i used to work for the button component because it inherits from the movieclip class and the movieclip class also has x and y properties.
Participant
August 13, 2007
You're my hero.

Now is it possible to get a quick explaination for why they're different?
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
August 13, 2007
try: