2 text fields 1 scroll bar

  • Stonucca
  • Born
  • Born
  • Stonucca
  • Posts: 4

Post 3+ Months Ago

Hi I have managed to get a scroll bar to move 1 text field is it possiable to get it to move 2 text fields

Heres the code
Code: [ Select ]
function addItems() {

    myText.multiline             = true;
     myText.wordWrap             = true;
     myText.type             = "dynamic";
      myText.background             = true;
     myText.backgroundColor         = "0x000000";
     myText.border             = false;
    myText.html             = true;

    myText2.multiline             = true;
     myText2.wordWrap             = true;
     myText2.type             = "dynamic";
      myText2.background         = true;
     myText2.backgroundColor         = "0x000000";
     myText2.border             = false;
    myText2.html             = true;

    myText.htmlText = myData.myText;
     ScrollBar.setScrollTarget(myText);
    
    myText2.htmlText = myData.myText2;
     ScrollBar.setScrollTarget(myText2);

    formStyleFormat             = new FStyleFormat;

        formStyleFormat.scrollTrack     = "0x000000";
        formStyleFormat.highlight      = "0x000000";
        formStyleFormat.highlight3D     = "0xffffff";
        formStyleFormat.arrow     = "0xffffff";
        formStyleFormat.face         = "0x000000";
        formStyleFormat.background     = "0x000000";
        formStyleFormat.shadow    = "0x666666";
        formStyleFormat.darkshadow    = "0x333333";
    
    formStyleFormat.addListener(ScrollBar);
    formStyleFormat.applyChanges();
    
    textFormat             = new TextFormat();
    textFormat.color             = "0xffffff";
    textFormat.bullet             = false;
    textFormat.underline             = false;
    textFormat.bullet            = false;
    textFormat.size            = 14;
    textFormat.font            = "arial";
    
    myText.setTextFormat(textFormat);
    myText2.setTextFormat(textFormat);

    }
  1. function addItems() {
  2.     myText.multiline             = true;
  3.      myText.wordWrap             = true;
  4.      myText.type             = "dynamic";
  5.       myText.background             = true;
  6.      myText.backgroundColor         = "0x000000";
  7.      myText.border             = false;
  8.     myText.html             = true;
  9.     myText2.multiline             = true;
  10.      myText2.wordWrap             = true;
  11.      myText2.type             = "dynamic";
  12.       myText2.background         = true;
  13.      myText2.backgroundColor         = "0x000000";
  14.      myText2.border             = false;
  15.     myText2.html             = true;
  16.     myText.htmlText = myData.myText;
  17.      ScrollBar.setScrollTarget(myText);
  18.     
  19.     myText2.htmlText = myData.myText2;
  20.      ScrollBar.setScrollTarget(myText2);
  21.     formStyleFormat             = new FStyleFormat;
  22.         formStyleFormat.scrollTrack     = "0x000000";
  23.         formStyleFormat.highlight      = "0x000000";
  24.         formStyleFormat.highlight3D     = "0xffffff";
  25.         formStyleFormat.arrow     = "0xffffff";
  26.         formStyleFormat.face         = "0x000000";
  27.         formStyleFormat.background     = "0x000000";
  28.         formStyleFormat.shadow    = "0x666666";
  29.         formStyleFormat.darkshadow    = "0x333333";
  30.     
  31.     formStyleFormat.addListener(ScrollBar);
  32.     formStyleFormat.applyChanges();
  33.     
  34.     textFormat             = new TextFormat();
  35.     textFormat.color             = "0xffffff";
  36.     textFormat.bullet             = false;
  37.     textFormat.underline             = false;
  38.     textFormat.bullet            = false;
  39.     textFormat.size            = 14;
  40.     textFormat.font            = "arial";
  41.     
  42.     myText.setTextFormat(textFormat);
  43.     myText2.setTextFormat(textFormat);
  44.     }


any help much apprieciated

Ston
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • uknightuss
  • Graduate
  • Graduate
  • uknightuss
  • Posts: 196
  • Loc: Los Angeles

Post 3+ Months Ago

I would probably have tried to use the built in "Scrollbar Component", which you drop in place on top of your desired text field. If I remember correctly off the top of my head your text field must have an instance name for the scrollbar to be able to target. So what I would try is making the two different text fields have the same instance name, and have the scrollbar component target the "instance name".

That's my :my2cents:
  • Stonucca
  • Born
  • Born
  • Stonucca
  • Posts: 4

Post 3+ Months Ago

Thanks nice idea

but as I understand it if I give them the same instance name
I wont be able to import the text to seporate fields

But will give it ago

Cheers Ston
  • uknightuss
  • Graduate
  • Graduate
  • uknightuss
  • Posts: 196
  • Loc: Los Angeles

Post 3+ Months Ago

that's a good point, I had not thought about that.. Hopefully you will get it figured out though!
  • yuriythebest
  • Banned
  • Banned
  • User avatar
  • Posts: 143
  • Loc: Ukraine

Post 3+ Months Ago

hmm, you could make your own scroll bar that consists of 2 buttons and a movie clip, inside the movie clip you can have your 2 textfields, and the buttons will simply increase/decrease the _y property of that particular movie clip, I have done so and it works perfectly!

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 13 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.