A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Dynamic text scrolling with text field

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    22

    Dynamic text scrolling with text field

    Hello,
    I've created a textbox that's getting dynamic text, I've got a font size set, but I notice if I change the dimensions of the field, the font size scales as well.
    I'd like to be able to change the dimensions of the field in the prop. inspector without scaling the actual text size. What am I missing here?

    Thanks,
    Z

  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Your not missing anything. Easier to make a new text box of the right size. Better yet, do it this way.
    Attached Files Attached Files

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You don't change the textfield's size by setting dimensions in it's properties, but by, after making sure the textfield is set to Scrollable (under TEXT), adjusting it's size with the little black square handle on the bottom-right of the textfield, that will appear when you click on the textfield.

  4. #4
    Junior Member
    Join Date
    Jun 2002
    Posts
    22

    attached file

    Thanks,
    I know I could look it up, but how do I specify font size when creating the field? The text is really tiny on this file, and all I see is boolean values (besides the dimensions):

    ------------

    stop();

    this.createTextField("tut",1, 0, 0, 240, 135);
    tut.html = 1;
    tut.border = 0;
    tut.multiline = 1;
    tut.wordWrap = 1;
    tut.textColor = 0xffffff;
    loadVarsText = new loadVars();
    loadVarsText.load("test.txt");

    also there's an error:
    **Warning** Scene=Scene 1, layer=actions, frame=1:Line 9: Case-insensitive identifier 'loadVars' will obscure built-in object 'LoadVars'.
    loadVarsText = new loadVars();

    (I changed loadVars to LoadVars and it seems ok)
    Also thanks to the "using the handle" tip as well, though I think I would almost prefer to set values numerically. Can I set position as well this way?


    Thanks,
    Z

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    TextFormat.size in the TextFormat(object).

  6. #6
    Junior Member
    Join Date
    Jun 2002
    Posts
    22

    oops --size set in html

    I just noticed that the size was set in the text file with an html tag (although font size="10" wouldn't mean anything to a regular html page) I was originally hoping to use stylesheets, but have to use flash 6, and they don't work there.

    I also wanted to ask if that was the scrollbar component you're using, or if you built it from scratch? This is much easier than the older code I was using to build the scrolling functionality.

    Thanks,
    Z

  7. #7
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    It's some generic scrollbar I saved from somewhere. A book with CD, I think, not sure. Anyway, it's not a component, which is why I use it.

    When using MX 04, you have to change the loadVars to LoadVars.

    Dynamic text boxes can have html formating or not, that's what the tut.html = 1; line is for. 1 or 0 meaning true or false, in this case, so it's set for true, so you can use some html text coding in the txt file.

    That fla was just quick and dirty, it would be much better to size the box, then determine just where to position the scroller, so it's closer to the right edge of the box. The really nice thing about this is it will work from inside a movie clip, so you can put it anywhare, use it as standalone or load it to another movie. You could really get artistic and add layers for background colors or pics and a frame.

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    When using MX 04, you have to change the loadVars to LoadVars.

    It was LoadVars(); in MX also! As opposed to loadVariables...

  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Well, it works in MX, without an error notice, but not in 04. In fact, when I first got 04 and tried some of these old MX files and got that error, I was stumped at first.

  10. #10
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Yes you're right! MX2004 (I'm but on MX still...) is more case sentive than MX was, but my point is that the actual correct syntax in MX, although loadVars did work, was LoadVars and has always been!

  11. #11
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Ah, OK, point taken, although I've never seen the documentation on it. In fact, loadVars is not in the MX reference files, and 04 doesn't have any reference files at all.

  12. #12
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Ummmmmmmmh! The LoadVars(object) in the Help files, AS dictionary, under G-L? It's all there! And no small "l" to be found!

    Or here...

    http://www.macromedia.com/cfusion/se...&Submit=Search

    http://www.macromedia.com/support/fl...ionary427.html

  13. #13
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Who uses Help? But I found that under load and loaded in the Index part of the actions panel, to the left, it does say LoadVars. Hmmmmm. Would it work with just load?

    OK, this is why it works, it is using load;

    loadVarsText = new loadVars();
    loadVarsText.load("test.txt");

  14. #14
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    BTW, another indicator that it's the wrong syntax (but you may not have been using that as you've haven't used Help!), loadVars doesn't change to the default blue command color when typing it in the actions window. But LoadVars does!

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