Link to home
Start Free TrialLog in
Avatar of cosbahr
cosbahr

asked on

flash news scroller- automatic scroll

I'd like to create a flash news scroller that loads an external text file. I want it to scroll continuously  without scrollbars. I would also like a mouseover color change when the user points to a section of text then and have it change back to the original color on the mouseout.

I've looked at several tutorials but they all seem to incorporate scrollbars. I am able to load the text file in with no problem, but I how do I make it loop and do the mouseover?

Thank you
Avatar of Dushan Silva
Dushan Silva
Flag of Australia image

1.) Create a Text box. (Dynamic Text, Multiline)'
     Give instance name as "myText".

2.) Put following action script on you first frame.
   
     System.useCodepage = true;
     myLoadVars = new LoadVars();
     myLoadVars.onData = function(_data)
     {
      if (_data != undefined)
      {
            myText.htmlText = _data;
      } else
      {
            trace("loading fails...");
      }
    };
    myLoadVars.load("mydata.txt");

3.) Then create a text file in the same folder name as "mydata.txt" . Then enter the details which you want to show in the txt box.
Avatar of cosbahr
cosbahr

ASKER

Thank you. I have that part working. How do I make the box scroll continuously and how do I do the mouseover?
To change color when mouse over you must convert this text box as a symbol. Then you can give action script to change color in
on(rollOver){
            my_color = new Color(myText);
            my_color.setRGB(0x993366);
}

BR Dushan
Avatar of cosbahr

ASKER

Hi should it be  a button symbol or movie clip?
It should be a movie clip.

BR Dushan
Avatar of cosbahr

ASKER

Hi,

I converted the dynamic text box to a movie clip and named it. I dragged it from the library to the stage. Now it won't load the text file. Am I doing something wrong?
Yes. You must put action script in (point 2.) in the movie clip's first frame. Not in the main movie.

BR Dushan
Avatar of cosbahr

ASKER

Hi, Here's what I have. In the first frame I have in the actions

System.useCodepage = true;
     myLoadVars = new LoadVars();
     myLoadVars.onData = function(_data)
     {
     if (_data != undefined)
     {
          myText.htmlText = _data;
     } else
     {
          trace("loading fails...");
     }
    };
    myLoadVars.load("mydata.txt");


In the second frame I have a movie clip that was made from a dynamic text box and it's name is myText. Are you saying to move the above code to the second frame?
Avatar of cosbahr

ASKER

Hi, I did get that to work. The file is now displaying.

Where do I put this

on(rollOver){
            my_color = new Color(myText);
            my_color.setRGB(0x993366);
}

When I put it in the actions for the movie clip it says it must be a button to use on rollover.

Thanks so much
Put that action script to the movie clip, which is in main stage.
(Select your movie clip which is in main movie, then put action script to it.)

BR Dushan
Avatar of cosbahr

ASKER

Great, I finally have it. Thanks for your patience. Do you know how I could make the box containing the external file scroll continuously? If not I can post it as a separate issue.
ASKER CERTIFIED SOLUTION
Avatar of Dushan Silva
Dushan Silva
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial