This content has been marked as final. Show 6 replies
Break this task into its parts: request the data, receive the data, display the data, pause the data, move the data.
You are using HTTPService to get the data. Keep in mind that it is asynchronous, so use a result event handler to capture the XML as it is received.
For the display, you can use a Canvas (turn off its scrolling policy) and a Label within it. You can move the Label with the Move effect. When you need to pause it, stop the Move effect and use the Timer class to sleep for a bit, then create a new Move effect and let it go.
You can calculate how far to move the label and when the Move effect has completed, an event will fire. You can then start the Move effect again (if you give the Move effect an xFrom and an xTo the Move effect will first locate the Label at the xFrom position so you don't have to do that yourself).
Thanks for the tips, thats exactly what i ended up doing.
If anyone is interested in seeing the code let me know and ill post it.
Can I see your code?
peterent, it's quite clear how to create a ticket tape with moving text.
I'm a total newbie in Flex, so I wonder - how can I implement table (DataGrid?) moving, based on your script? I need only "up-bottom" and "bottom-up" moving directions.
For example, I have an collection of XML objects, describing product prices: product name, price, and an image "up"/"down" showing the price change for the given time period. When the first row "drives off" the screen, it should appear as the last one.
Say, there are 10 products. As I see the solution now - I can just change Labels in your code to DataGrid objects and update the moving logic, and it will work. Am I right?
You should just be able to replace the Text (or Label, I forget which I used) with a DataGrid - or any Flex component. Just remember that there is more graphics so it might appear to be shaky when it moves.