-
Changing Dynamic text from function
Hello,
I'm trying to change the text in a dynamic text box (which itself I've created by createTextField through actionscript), and I'm trying to do it from within a function. However, I can't seem to do it!
Basically, I've go this bit which creates the text box:
_root.createTextField("mytext",105,125,428,300,100 );
mytext.text = "TEXT DISPLAYED";
myTextFormat = new TextFormat();
myTextFormat.font = "Arial";
myTextFormat.size = 11;
myTextFormat.color = 0x999999;
myTextFormat.align = "right";
mytext.setTextFormat(myTextFormat);
textInstance.setTextFormat(myTextFormat);
and then later on I have a function which fades in an image when a button is pressed:
buttons_mc4.four_mc.onRelease = function() {
new Tween (container_mc,"_alpha",Strong.easeOut,100,0,20,fal se).onMotionFinished = function(){
container_mc.loadMovie("../images/4.jpg");
fadeIn();
}
}
I tried putting this in to change the text in the dynamic text box but it didn't work:
buttons_mc4.four_mc.onRelease = function() {
new Tween (container_mc,"_alpha",Strong.easeOut,100,0,20,fal se).onMotionFinished = function(){
container_mc.loadMovie("../images/4.jpg");
fadeIn();
}
mytext.text = "TEXT DISPLAYED";
}
any ideas what I'm doing wrong?
All suggestions greatly appreciated! Cheers.
-
Developing For Dunkets
try resetting the text format
PHP Code:
fadeIn(); } mytext.text = "TEXT DISPLAYED"; textInstance.setTextFormat(myTextFormat); }
-
Thanks very much. It works! Cheers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|