How to Use the Tweener as a Dynamic Text Field

Using Tweener, a plug-in for Adobe Flash Professional, as a dynamic text field position controller lets you control the motion path and easing (velocity and acceleration) of text within a Flash animation. This gives you the ability to make text bounce, letters jump, numbers fly and punctuation accelerate. Tweener makes coding of text motion easy with a simple method format. The Tweener methods lets you directly specify arguments for the motion path type, the motion easing and the motion shape morphing.

Instructions

    • 1

      Download Tweener from the Google website. Move the "caurina" file folder that you downloaded to the directory in which you plan to create and save your Flash text field animation program.

    • 2

      Start the Flash program. Click "Flash File(ActionScript 3.0)" from the splash window to create a new file for your Tweener text animation code.

    • 3

      Select "Actions" from the "Window" menu on the main Flash menu bar to open the ActionScript 3 editor. Position your mouse cursor on the first line of the ActionScript 3 editor. Click your mouse button, and type in the code below (without quotations) to import the Tweener package caurina.transistions.Tweener.

      "import caurina.transitions.Tweener"

    • 4

      Type the code starting at the next line of the ActionScript 3 editor to create a dynamic text field (a text field that will display text in a text box that is generated with AS3 code). Specify the "autosize" property to "TextFieldAutoSize.CENTER" so that the displayed text "Texfield Animation Program" will be shown in its entirety and centered in the text field.

      var dynamic_Text_Field:TextField = new TextField();
      dynamic_Text_Field.text = "Textfield Animation Program!";
      dynamic_Text_Field.autoSize = TextFieldAutoSize.CENTER;

    • 5

      Type in the code, starting at the next line of the ActionScript 3 editor, to specify a text formatting object named "dynamic_Text_Format" that has properties that set the text's color to the RGB color "EE00E0" and the text's font size to 63 points.

      var dynamic_Text_Field_Format:TextFormat = new TextFormat()
      dynamic_Text_Field_Format.color = 0xEE00E0;
      dynamic_Text_Field_Format.size = 63;
      dynamic_Text_Field.setTextFormat(dynamic_Text_Field_Format);

    • 6

      Type in the code, starting at the next line of the ActionScript 3 editor, to add the text field to the stage and tween the text field such that it moves from the top left corner of the screen (coordinates 0,0) to coordinates 280, 300. Use a time argument of 9 (9 seconds) to specify the amount of time the text field will take to move between these coordinates on the screen; a delay argument of 0 (zero seconds) to specify the delay between the time the tweener command is executed and the time the text field moves on the screen. Specify the apha argument as 0.1 to have the text field's text opacity change from 1 (completely opaque) to 0.1 (almost completely transparent).

      this.addChild(dynamic_Text_Field);
      Tweener.addTween(dynamic_Text_Field, {x:280,y:200, time:9, delay:0, alpha:0.1});

Learnify Hub © www.0685.com All Rights Reserved