• home
  • forum
  • my
  • kt
  • download
  • Bulleted Text with CSS in Flash

    Author: 2008-10-09 08:41:06 From:



    Free Flash Tutorials, Using CSS in Flash, Bullet Text

    This is done in the text field and the bullet is a simple Movie Clip.

    Create you bullet Movie Clip and draw it like you want, I made four different bullets as examples:
    Free Flash Tutorials, Using CSS in Flash, Bullet Text

    Set the identifier for you bullet, I am going to use the square one, so my identifier will be "square".

    Open the actions for the first frame in the main timeline and paste:
    _root.createTextField("textBox", 33, 100, 100, 300, 300); //let our text box have more than one line textBox.multiline = true; //wrap the text if it's too big textBox.wordWrap = true; //allow the use of html or CSS textBox.html = true; textBox.htmlText="<img src='square' vspace='5' hspace='10'> Item 1</textformat><br><br> <img src='square' vspace='5' hspace='10' >Item 2 </textformat><br><br><img src='square' vspace='5' hspace='10' >Item 3</textformat> <br><br><img src='square' vspace='5' hspace='10' > Item 4 </textformat><br><br>";

    In the first line we created a text box with these parameters:
    _root.createTextField("name", depth, _x, _y, width, height);

    You have to make the width and height big enough to fit all of our text.

    In the last part of the code where we set the hmltText of our text box we used some CSS code:
    //this is the code for the first item <img src='square' vspace='5' hspace='10' >Item 1</textformat><br><br>

    For the image source we used "square", which is the identifier of the bullet Movie Clip. "vspace" and "hspace" is used just to centralize the bullet with the text.
    The rest of the CSS code is the same thing, just change the text between the tags or the identifier if you want to use different bullets:
    Free Flash Tutorials, Using CSS in Flash, Bullet Text

    To use this you always have to dynamically set the text or it won't work

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      3D (20)
      Math Physics (14)
      3rd Party (5)
      Navigation (60)
      Actionscripting (26)
      Optimization (16)
      Animation (32)
      Projector (9)
      Audio (46)
      Special Effects (112)
      Backend (25)
      Text Effects (65)
      Drawing (18)
      Tips and Techniques (41)
      Dynamic Content (28)
      Tricks (8)
      Games (97)
      Utilities (21)
      Getting Started (91)
      Video (24)
      Interactivity (43)
      Web Design (29)

    New

    Hot