Help Dynamic Text problem

Posted by ray77 
Help Dynamic Text problem
November 30, 2008 08:03AM
Basically to make a long story short. I am just starting today and have the free version and am not sure if i need the purchased version to do what i want. I add a dynamic txt and apply all of the correct settings and embedding characters etc in the panel. If I just show and hide programmically it works fine the effects work forever. If I try and change the text via DynamicText.text the text disappears and the effects stop working. if I try to use the MyEffect.target.text like in some examples I get a compiler error. I am using CS4. Am I missing any imports? Do I need to upgrade??? Help.

function mouseOverAll(event:MouseEvent):void {

changeText(event.currentTarget.name);

}

function mouseOutAll(event:MouseEvent):void {

resetText();
}

function changeText(targetMain:String):void {

switch (targetMain)
{
case "Green1":

THIS DOESNT WORK AS IN EXAMPLE AND GIVES COMPILER ERROR-->
//MsgTwo.target.text = "TIER III Design";

ONCE I CHANGE TEXT THIS WAY DYNAMIC TEXT DISAPPEARS BUT TEXT IS CHANGED-->
TextTwo.text = "HelloTwo";

//MsgThree.target.text = "TextTfhree";

//trace(TextTwo.text);
break;
case "Green2":

FAILS-->
TextTwo.text = "TIER III";
TextThree.text ="Description";

//trace(TextTwo.text);
break;
default:
break;
}

//MsgOne.transitionEffect("hide");
//MsgTwo.transitionEffect("show");
//MsgThree.transitionEffect("show");
MsgOne.hide();
MsgTwo.show();
MsgThree.show();

}

function resetText():void {
//clear the dynamic text
//MsgOne.transitionEffect("show");
//MsgTwo.transitionEffect("hide");
//MsgThree.transitionEffect("hide");
MsgOne.show();
MsgTwo.hide();
MsgThree.hide();
}
Re: Help Dynamic Text problem
November 30, 2008 09:35PM
OK, I figured out what the problem was. I had Auto kern checked in my Dynamic Text "CHARACTER" settings. So, since I spent so much time on it I will give a rundown on everything that has to be set up for dynamic text to work properly. I hope I can help the next guy out.

Add Dynamic Text to stage
Set Dynamic Text Settings: CHARACTER-> Auto kern must be unchecked and Character Embedding must cover all possible values (in my case it was just the UPPER and LOWER case)
Add Effect to Dynamic Text
Set Panel settings: uncheck autoPlay

Control in AS with Effect.show() and Effect.hide(); and just use DynamicText.text ="new value" when you want to change the value of your text;

It all works fine for me now.

What I should have done is made sure my text was changing in the first place before I even added the effect which it wasnt. I then found in some forum that the text will disappear if I dont uncheck Auto kern. I got ahead of myself and it cost me time like it always does.... so i hope this helps someone else out and saves some time getting you there.
Re: Help Dynamic Text problem
December 01, 2008 08:29PM
Thanks for this!
Re: Help Dynamic Text problem
December 02, 2008 07:16AM
@ray77

Thank you for sharing this. Indeed, you need to make sure that all the characters you are using are embedded from the start. Also, instead of using TextField.text to set the new text into the text field we would recommend using the htmlText property, since the effect itself requires that the "Render text as HTML" option is activated. Further more, the auto kerning setting should have nothing to do with the animation. The animation should run regardless of what is the kerning setting.
Sorry, you do not have permission to post/reply in this forum.