ActionScript 3.0 :: Scrolling News Ticker - XML Nodes Not Loading
Mar 10, 2008
I am trying to make a AS3 version of a scrolling news ticker although Iseem to be having trouble. The code below doesn't seem to be working although its not throwing any errors. I think its not loading my xml nodes or something. All I am trying to do is it to eventually load an rss feed and scroll a selected set of nodes. For now I just tried to get it to display an xml formated file since rss is xml formated. Ultimately for this example I just want it to display the title attribute of every item.
Code:
news_txt.x = 1024.0;
var count:int;
var textnode:String;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
[Code] .....
I am action script handicapped so bare with me. I know very basic action script functions like go to frame stop, play ect So complicated flash code does not really work for me unless it is explain easy and clear step by step. I know the animation portion of flash which helps me get by. I need to know how to pause a scrolling text as simple as possible when I click mouse over it.
I created a button (which is really displayed as text so that I can link to a website url) (SEE IMAGE)
The text is animated from frame 1 off screen to frame 400 top off canvas off screen. I did this the animation way instead of the coding way. So it should scroll from bottom to top (which I animated with frames), link to a new site (which I figured out), and pause on mouse over and play on mouse off.
My text animation scrolls from left to right, which is OK. I want to keep it simple but change it up little. How do I get the text to go right to left?
AS3 Example
mask = customMask; var my_str:String = " Ad hoc ad loc and quid pro quo "; function addUm():void { my_str = my_str.charAt(my_str.length - 1) + my_str.slice(0, my_str.length - 1);
looking to build a horizontal news ticker like you would see at the bottom of the screen on CNN etc except it will only display one item at a time. Just thinking and planning before I start.... If the news ticker is only going to be wide enough to display one news item at a time, will my flash load all of the xml news data as soon as it launches and hide all the content that is outside of the ticker width or would/should it only load/display each news item individually when it is that items turn to display in the ticker?
I have been working on a dynamic loading news ticker for a site and have been running into two separate problems:
The first, creating a movie clip, inserting the following code: var myTextLoader:URLLoader = new URLLoader(); var myTextField_txt:TextField = new TextField(); myTextField_txt.wordWrap = true; myTextField_txt.autoSize=TextFieldAutoSize.LEFT; [Code] .....
And having the clip load the text from the text file listed. In this version, everything is working fine except I don't have the ability to change the font, size, and color of the text using only flash and the text document, (to my understanding).
The second, creating two .fla files, one with the embedded font I want to display named font.fla, and the other blank named fontloader.fla. Also create an .as file in the folder with the following code: package { import flash.display.Loader; import flash.display.MovieClip; import flash.events.Event; import flash.net.URLRequest; [Code] .....
In this second scenario, the problem is that I can't figure out a way to make the dynamic text scroll vertically and loop, (Was trying to figure out a way to save the fontloader.fla as a movie clip, then importing it into a new .fla and just using a motion tween on the clip, but so far I'm confused by it). This second scenario is also not my first choice, because loading the text straight from a text file would make the news section very easy to update for those who don't have any design experience.
I created a News Ticker in Flash CS3 from a tutorial on your site URL...But it just flashes "undefined" I know I must be messing something up with the location of the XML file or where it's defined in the action script. I don't think I understand the "cache" part of the tutorial or why the file can't be local? I have gone to the suggested links in the tutorial, and being a total novice, I must be missing some main point.
I just want a horizontal news ticker that loops a bunch of news headlines that are housed in an xml file. the headlines will link to pages will the full news story.
How can I make such a News-Ticker as on URL...(The nice box, which has 4 advertisements is ment)I´m making a website for a friend and want to add something like this. Unfortunately its the first time I´m using Flash.
Anyone know of a good news ticker component? (Or a straightforward way of coding one in AS3?) We need to incorporate a horizontal ticker at the bottom of a site. It doesn't need to feed RSS. It'll just be populated with little factoids the client will provide. I initially purchased and integrated this one[url]...
Worked pretty well. Unfortunately, the developer who is building out the site just informed us that we need one that works in a .net environment and this component parses the XML through PHP. I'm a noob at all this so I don't even know exactly what I'm talking about!
how to create a dynamic news ticker like one of these? Only that it would scroll longer sentences? Of course the first idea is just load single line TextField and tween it across the screen beneath a mask. I don't like this because
a) It's retarded b) Your swf width is quite long even if you don't see it, it's there. c) It's retarded
I'm trying to think up a better solution. So far I haven't thought of anything better (does that mean I'm retarded?). Some other brain stormed ideas could be parsing each word in the String into it's own Sprite, as BitmapData, and sort of train tweening those, that was you can dispose each after it's cleared the screen. This seems like too much work, and potentially draining on the system's resources, having to create new instances, and repeteadly add them to the display list, and such.
I bought a flash news ticker from the site Flash Den but haven't been able to do much with it because it's in AS2 and I only really know AS3.The news ticker loads the text/link from an XML file, but it has a problem loading characters such as forward slashes (/), colons (:) as well as other characters?
What I am trying to do is like a news ticker, except a swf loads in and takes the place of the one previous. I wanted it to change every 6 seconds. Using the Random Loading SWF Tutorial as a base [URL]. How do you make it not random? I just want it to load the list I give it in order with a 6 SECOND DELAY.
I've made a horizontal news ticker that scrolls a string from right to left using substring method and by changing the alignment. This works OK but I would like the text to start displaying again before it disappears completly off the left of the screen. I've attached the fla and swf.
I'd like to add a second news ticker text field right beneath the first one that loads its headlines from a different XML file. So my question is this -- (not very XML savy mind you...) How would I need to adjust the AS code to be able to have both text fields going at the same time? What parts of the AS code can be omitted? (to not have redundant functions) Is there anything I should be aware of that might be cancelling out the second text field from running? At this point, I can get only one of the tickers working at a time -- the other just sits empty.
I need help related to kirupa's News Ticker Tutorial. I want the text to be fade in like it's fade out. Currently the text does not come with fade in effect. You can see the news ticker here: [URL]
I want to make a news ticker based on the Kirupa News Ticker Tutorial URL...My concept is that in the main stage I will put a combobox component with news categories like 1. Sports 2. Financial News 3. Politics/If you choose "Sports" it should load a sports.xml file that has the main sports headline news.If you choose "Financial" it should load a financial.xml file that has the main Financial headline news.I used this code [code]
I using the news ticker example to create a flash sig for my blog of highlighted posts. The question is there anyway of creating an automatic xml updater? So that all I would have to do is place some sort of "highlighter" tag in a post, then the xml file would be updated, thus a new link appear in the news ticker? I guess if I some how had rss for a tag, that then the xml was read into the flash file.
I have a news ticker that I modelled after the kirupa tutorial that was given: [URL]
When I run it on my local machine it works just fine the way I expect it to. However when I put it on my website, it does not work at all. I have another flash file (.swf) on my webpage which is just a simple countdown timer and that works just fine so I don't think this problem has anything to do with MIME types.
Here is the code I used to embed the .swf file onto my website:
<script type="text/javascript"> var so = new SWFObject("http://428the.calvin.hostingrails.com/XMLParser/sports_ticker1.swf", "headerAnimation", "390", "180", "0", "#FFFFFF");
[Code].....
Neither of these worked. I just have no idea what I am doing wrong. I don't know if there is something I should be coding differently in my actionscript. I am very new to AS programming. how to get the .swf file to appear on my website would be great.
I'm making a very simple news ticker that uses XML to load four items: copy text, an image, date and a URL. The script was pieced together from tutorials and a bit of self-teaching, so I know it's probably not great. The AS is pasted below. Everything loads just fine, but the button script returns an "undefined" error. I assume this is because the item is no longer found in the array, but I'm not entirely sure. I also think it may be that the loadMovie method isn't working well with a specific item in the array. Also the link does not work. *Note* I know there are probably more advanced ways to tackle this but I'd like to keep this at my learning level so I can grow with it. :-)
I'm trying to embed a handful of European language characters into a little flash news ticker (Swedish, Norwegian and some others). I'm embedding my swf file in the html and passing a FlashVars variable This is the text that the ticker displays. For some reason the swf doesn't render the character when I put a foreign character such as in the HTML. I have embedded all these fonts in the dynamic text box in my .fla
Attached is the .fla and .html file where you can input the text for the swf to display. Please have a look for me! (attached zip at bottom of post)
I want to make a scroller that can be just a scroll bar, no arrows, another one with arrows and another one that scrolls by itsself very slowly, on mouse over of a news "item" it stops scrolling...
Only thing is that I want to include vector graphics in this scrollable area an so forth.As far as I know you can't mask dynamic text at all.
I am in the process of building a web site and am running into an issue with dynamic loading text.I am trying to make a scrolling news section with a stage of 200 W x 250 LCreated a movie clip with the following coding:
var myTextLoader:URLLoader = new URLLoader();var myTextField_txt:TextField = new TextField();myTextField_txt.wordWrap=true; myTextLoader.addEventListener(Event.COMPLETE, onLoaded); function onLoaded(e:Event):void {myTextField_txt.text = e.target.data;addChild(myTextField_txt);} myTextLoader.load(new URLRequest("myText.txt"));
Then set the clip (which is 250 W x 600 L) on the main stage, moving upwards, creating the auto scroll effect.The problem I am running into is that I can't figure out how to make the text use the whole width of the text box I created. It only uses half of the width, creating columbs like this:
Hello and welcome to our new
[code]...
The text box itself is at least twice the width of the sentences, but they aren't using the full width.
I'm trying to create a 'tickertape' (horizontal scrolling text that reloads and loops in a masked window once finished playing). At the moment for visual purposes I have generated the following. This is linking to a movieclip at the moment but doesn't loop once finished... it just keeps incrementally scrolling until it probaby ends up in infinity somewhere...