dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: changing font color dynamic textfield

  1. #1
    .:Build for Design:. kdesign1's Avatar
    Join Date
    Apr 2002
    Location
    TheNetherlands
    Posts
    316

    changing font color dynamic textfield

    Hi there, what I want to do is changing the font color of a dynamic textfield when a user pressed a button. The blacktext has to become red and stay red untill the user clicks another dynamic textfield (menu option). The thing is I use duplicate movieclip and I'm stuck like h*ll. Now I use a button which changes color at a really simple way, but because the font has to stay red when clicked > I have to do it by actionscript, but how???

    This is what I got for now:
    Example .swf

    Download fla:
    Example .fla*
    Example .txt*
    (*both needed to run the menu)

    Thanx for helping me out
    ---------------------------------------------------
    * Freelance multi media designer http://www.andrekreft.com/
    * .Get Inspired! Magazine http://getinspiredmagazine.com/

  2. #2
    Goooold Member!
    Join Date
    Oct 2002
    Posts
    259
    You need to use a TextFormat object. Here's an example:

    MyFormat = new TextFormat();
    with (MyFormat){
    font = "arial";
    color = 0xff0000; //this is Red
    underline = false;
    bullet = false;
    bold = false;
    italic = false;
    }

    That creates a new TextFormat object called MyFormat. Then you just apply that format to the textfield when the button is clicked.

    on (release) {
    setTextFormat(MyFormat);
    }

    There's plenty of info on dynamic text formating in the "refernce" panel in FlashMX. You should learn to use that, it is very valuable.

  3. #3
    .:Build for Design:. kdesign1's Avatar
    Join Date
    Apr 2002
    Location
    TheNetherlands
    Posts
    316
    thanx Cyanide300, so I have to get rid off the button and use the textformat property, but is this also the way to set a menu item to red and stay red before clicked another menu item?
    ---------------------------------------------------
    * Freelance multi media designer http://www.andrekreft.com/
    * .Get Inspired! Magazine http://getinspiredmagazine.com/

  4. #4
    .:Build for Design:. kdesign1's Avatar
    Join Date
    Apr 2002
    Location
    TheNetherlands
    Posts
    316
    I insert the first code into the first frame. And putted the on (release) code onto the button, but nothing happens....Do I have to call the textfield that I'm using MyFormat?
    ---------------------------------------------------
    * Freelance multi media designer http://www.andrekreft.com/
    * .Get Inspired! Magazine http://getinspiredmagazine.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center