FORUMS: list search recent posts

Creating a Text Ticker in Flash ... but how?

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Thomas Giegerich
Creating a Text Ticker in Flash ... but how?
on Apr 4, 2009 at 11:57:00 pm

Hi there

i am very new to Flash and got a beginners question. For some live video things i do, i would need some easy way of creating horizontal scrolling typo movies, which must be endless loops. Like a ticker text for stock prices - but with names of people. So a name just scrolls from the right side of the screen to the left side, while the next one is following it with a little gap. If i find out how it works in this forum, i will post an example ;-)

What i do up to now is creating those in After Effects, render them out as movie and let Quick Time play those in full screen. Problem is that it is quite time consuming to do all those things as a movie, as i always have to find the loop point manually.

Would there be a chance to do a Flash thing, where i could just type in a name (never longer than 50 characters) and the software would make that a loop? In my mind it can not be that difficult. All the script would need to do ist read the text from the beginning, find out it reached the end and start reading the text all over again. As i know that Flash can somehow handle live text, it should not be to complicated to feed text with this method into it probably. But i am not a programmer ;-)

Hope that i did not explain all that too complicated and that someone on here could shed some light on that for me. If Flash would be able to do something like that, i would love to learn it.

Thanks for any help
Thomas


Return to posts index

Abraham Chaffin
Re: Creating a Text Ticker in Flash ... but how?
on Apr 6, 2009 at 9:24:13 pm

Here's a basic ticker that would work. Just modify the top two variables to start and test. The other variables can be altered if you know a little bit for fine tuning.

All you need to do to have this work is create a new as3 document in flash, click frame one, paste the code into the action script window, size the document to your preferred size and you're done.


//SCROLLING SPEED
var scrolling_speed:int = 10;
//TEXT TO SCROLL
var text_to_scroll:String = "This is my text";


//establish the field
var my_text:TextField = new TextField();
//add the field to stage
addChild(my_text);
//set the text
my_text.text = text_to_scroll;
//set the x coord off right side of stage
my_text.x = stage.stageWidth;
//set y coord in middle of stage (about)
my_text.y = (stage.stageHeight/2)-(my_text.height/2);
//not selectable
my_text.selectable = false;
//no border
my_text.border = false;
//field scales with more text
my_text.autoSize = TextFieldAutoSize.LEFT;

//set a format
var my_text_format:TextFormat = new TextFormat();
//set the color to the hex
my_text_format.color = 0x000000;
//set the font size
my_text_format.size = 24;
//apply formatting
my_text.setTextFormat(my_text_format);

//add the listener to scroll
my_text.addEventListener(Event.ENTER_FRAME,move_text);

//scroll function
function move_text(myevent:Event):void {
my_text.x-=scrolling_speed;
if(my_text.x<(0-my_text.width)){
my_text.x=stage.stageWidth;
}
}


Abraham


Return to posts index

James Reimer
Re: Creating a Text Ticker in Flash ... but how?
on Aug 18, 2012 at 4:57:16 pm

How could this be modified to show the text string more than once on the stage? For instance to have it immediately follow each other without waiting for the previous to exit?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]