Link to home
Start Free TrialLog in
Avatar of yarekGmail
yarekGmail

asked on

flash simple button with text

Hello experts,

I have a simple Button in Flash cs5 - as3 called btn1 with a dynamic text called text_txt inside inside it.

The goal is simply to change the text BUT..

btn1.visible=true; // works fine
this.btn1.text_txt.text="hello"; // give a NULL error

My question is: how to programatically change the text that is inside that button ?


Avatar of dgofman
dgofman
Flag of United States of America image

btn1.label = "hello";
Avatar of yarekGmail
yarekGmail

ASKER

I have this issue not with  a button component but a button movieclip.

Create a rectangle. Press F8 and coose  button
Edit thr buuton and add a text.

Regards
Unless I'm wrong on this, I don't believe chlidren of a "SimpleButton" object are dynamically accessible. Instead you should make it a MovieClip symbol, and manually create all of the rollOver/rollOut behaviors with Actionscript.

Putting a dynamic TextField inside of a MovieClip IS accessible, so I would recommend doing it that way.
ASKER CERTIFIED SOLUTION
Avatar of blue-genie
blue-genie
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just curious why you accepted the answer from blue-genie when he was just agreeing with what I put first... Shouldn't I at least get some points for this?