CODE SNIPPET: Dynamic banner in a few clicks

TEXTFIELD

Documentation DCO Enabler -> ENABLER ADOBE ANIMATE CC -> TEXTFIELD

TextField

The textField category allows you to inject code in order to dynamize the textFields components.

Create a TextField field:

link_enabler

 

SetText

The setText method adds text to a textField without changing the text size (more info). 

Select the textField and click on “➜ setText”. “setText” injects the textField’s dynamization code.

link_enabler

Result: 

link_enabler

You will notice that the text has overflowed the textField area. The adaptText method will allow you to adapt your text according to its container.

 

AdaptText

The adaptText method allows you to adjust the font of your text (more info).

Select the textField and click on “ adaptText”

link_enabler

In order for the adaptText function to work, you must specify the minimum font size allowed, as well as the size of the textField.

link_enabler

Result: 

link_enabler

 

 

SetAndAdaptTex

The setAndAdaptText method adds and adapts your texts directly.

Select the textField and click on “➽ setAndAdaptText” .

Enter the desired minimum font size, as well as the size of the textField (more info), as displayed in the example below:

ADventori.Display.setAndAdaptText(this.textField_2,ADventori.data.wording,10,246,147);

 

 

VerticalAlign

The verticalAlign method centers your text vertically (more info).

Select the textField and click on “ verticalAlign”.

link_enabler

The following code is injected:

ADventori.Display.verticalAlign(this.textField_2,MaxHeight,Yposition);

Fill in the settings:

ADventori.Display.verticalAlign(this.textField_2,147,69);

Result:

link_enabler