Flash and ActionScript Tutorial - Creating Scroll Text

This tutorial was written for the Flash Designer software, which allows you to create flash animations in a much easier way than by using Macromedia Flash. You may get Flash Designer here.

The following tutorial illustrates how to create scrollable text object and use ActionScript to scroll the text up or down.

1. Launch Flash Designer and choose "Blank document" from the startup screen.

2. Choose "HTML Text tool" and draw a rectangle to create blank HTML text object. This will be the text to scroll.

image 1

3. Type some text in the "HTML Text" edit dialog:

image 2

4. Create scroll button. Choose "Button tool" and draw a button under the text.

image 3

5. Rename the button. After the button appears choose "Item" > "Edit Properties". Change button text to "Down".

image 4

6. Find out what is the name of HTML text. Select HTML text object and choose "Item" > "Placement Properties". Make sure the item name is "HTMLText1". If it's not change it to "HTMLText1" and click OK.

image 5

7. Specify the action script code to execute when the button is pressed. Select "Down" button and choose "Item" > "Actions" > "On Click". Select "ActionScript", type the following code and click OK:

image 6

8. You have to initialize HTMLText1.scroll value. Choose "Frame" > "ActionScript", type the following code and click OK. The code is execute before the frame is displayed.

image 7

9. Change the frame to static so the animation will not loop. Change "Delay" value to "Stop"

image 8

10. Now you can press F9 to preview the document in Flash player. Click "Down" button to scroll the text.

Hit "Esc" to quit preview. Create antoher button to allow scrolling up. Draw the button using "Button" tool. Use the following actionscript for button's "On Click" action:

HTMLText1.scroll = HTMLText1.scroll - 1;

To export Flash file choose "File" > "Export SWF File". Type the file name and click OK. To insert Flash in your web page choose "File" > "View HTML Code". Select entire HTML code, right click mouse button and choose "Copy" from the popup menu. Click Close. Paste the code to your HTML page.

Download Flash Designer source project: t1001.zip (1kb)


Close    To Top
  • Prev Article-Flash:
  • Next Article-Flash:
  • Now: Tutorial for Web and Software Design > Flash > Action Script > Flash Content
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Geek Tutorial
     

    Blogging Tutorial

      RSS Tutorial
      Podcasting Tutorial
    Graphic Design Tutorial
      Coreldraw Tutorial
      Illustrator Tutorial
      3D Tutorials
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial/ Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial/ Articles
     

    XML Style

      AJAX Tutorial
      XML Mobile
    Flash Tutorial/ Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial/ Articles
      Linux Tutorial
      Symbian Tutorial
      MacOS Tutorial
    Personal Tech
      Hardware Tutorial
      Software Tutorial
      Online Auction