Skip to main content
May 23, 2009
Answered

addChild(new button()) - How to add a name to this new created button

  • May 23, 2009
  • 1 reply
  • 1131 views

Hello,

Lost my old nickname, i was Pluda, now exPluda?.

well, tring to use a loop to add some buttons to my work, but need to reference their names so I can have diferent x positions for each. How to do that?

for ( var sm:uint = 0; sm < sub_menus.length; sm ++ ) {
        hsm.addChild(new bt_sub_menus());
        hsm.bt_sub_menus.x -= hsm.x-10;
        hsm.bt_sub_menus.y = hsm.bt_sub_menus.height+sm*15;

}

this does not work, i just get one button placed where I want.

Thanks!

This topic has been closed for replies.
Correct answer kglad

1  go to the forum faq section and send a private message to one of the admins to let them know.  they are very conscientious and helped me when my original kglad id was changed to kglad-HNsomethingorother.

2.


for ( var sm:uint = 0; sm < sub_menus.length; sm ++ ) {

var btn:bt_sub_menus=new bt_sub_menus()
        hsm.addChild(btn);
       btn.x -= hsm.x-10;
       btn.y = hsm.bt_sub_menus.height+sm*15;

}


1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
May 23, 2009

1  go to the forum faq section and send a private message to one of the admins to let them know.  they are very conscientious and helped me when my original kglad id was changed to kglad-HNsomethingorother.

2.


for ( var sm:uint = 0; sm < sub_menus.length; sm ++ ) {

var btn:bt_sub_menus=new bt_sub_menus()
        hsm.addChild(btn);
       btn.x -= hsm.x-10;
       btn.y = hsm.bt_sub_menus.height+sm*15;

}


May 23, 2009

Thanks a ton Kglad, worked perfectly :-)

1 - what is amazing is that my user profile says I'm in since 2003, I had abaut 1000 post's, 75% of them asking questions :-), and now I just have 111, something is very wrong in adobe's database.

Going to send that message to admin, thanks.

Pluda

kglad
Community Expert
Community Expert
May 23, 2009

they are aware of the problems and are actively troubleshooting with the jive people.  the admin that helped me was extraordinarily helpful and sympathetic.  in fact, he had sent me an email before i sent him a private message.