A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Scrolling Text

  1. #1
    Member
    Join Date
    Sep 2000
    Posts
    67
    Pleaseee help!!!!

    I am wanting to make a scrolling text box in MX.
    No problem, I can do it with the component 'Scroll'. Buts that not quite what I want.

    I simply want to have two arrows, and on rollover it smoothly scrolls my text up or down depending which arrow I rollover. What scrip would I need to use as right now I cant seem to make it work?


    ***

    And lastly, as the text box is dynamic, I appear to have to embed the font for it to keep the font when exported??? The problem is that I was using two font colours in the same box and when I export the movie it makes all the text the colour of the first character???

  2. #2
    Junior Member
    Join Date
    Feb 2002
    Posts
    8
    Flash won't allow you to have two different colours within a dynamic text box (or any kind of text box for that matter), so you'll just have to decide which colour you want to use for the whole text box.


    Originally posted by shack
    Pleaseee help!!!!

    I am wanting to make a scrolling text box in MX.
    No problem, I can do it with the component 'Scroll'. Buts that not quite what I want.

    I simply want to have two arrows, and on rollover it smoothly scrolls my text up or down depending which arrow I rollover. What scrip would I need to use as right now I cant seem to make it work?


    ***

    And lastly, as the text box is dynamic, I appear to have to embed the font for it to keep the font when exported??? The problem is that I was using two font colours in the same box and when I export the movie it makes all the text the colour of the first character???

  3. #3
    Member
    Join Date
    Sep 2000
    Posts
    67

    thankyou...

    so that answers the colour question..

    any help on the code,

    I simply want two arrow buttons to scroll my text on rollover as smoothly as possible>>>

    pleassee help?

  4. #4
    Junior Member
    Join Date
    Apr 2002
    Posts
    10
    To get two different colours in a dynamic text field your best option is to render the text field as HTML and then use basic HTML tags to specify text colour.

    e.g
    <*FONT COLOR="#FF0000">My Text HERE<*/FONT>

    (without the *'s)

    Would result in the red text below:
    <FONT COLOR="#FF0000">My Text HERE</FONT>

    Personally I'd load this data from an external text file or something, but u dont have to.

    Yet another option is to use the TextFormat object combined with selection.setSelection(startPos,EndPos,TextFormat) to set the font colour. This is a bit more complicated though. Check out the manual.

    Hope this helps,

    Tom.

    <p></P>

  5. #5
    Junior Member
    Join Date
    Apr 2002
    Posts
    10
    Ah, and the text scrolling ....

    (you are lucky i am feeling generous today.. i'd usually tell you to read the manual!!!)



    1) make a button (i'll call it "myButton")
    2) specify a variable in your text field (or an instance name in MX) : "myText"
    3)Assign the following actionscript to your button..

    myText.scroll = myText.scroll+1;


    4) do the same but with -1 to make it scroll the other way.


    5) just incase you dont know how to assign AS to a button, type this in frame one or your movie and you wont go far wrong:


    myText = "Your Text Here"

    myButton.onPress = function () {

    myText.scroll = myText.scroll +1

    }


    Ok?

    Tom



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