Logo         Community
The Company
Your Account
Contact Us
Building Data-Driven Flash Movies
Hook your Flash movie clips up to a database.

| No News Is Good News |

Now, you can develop some pretty cool applications with power like this...and one of the coolest (and easiest) is a dynamic news ticker, updated from a MySQL database. Let's see how.

First, pop open a new Flash movie and create a dynamic text box symbol, in the manner described on the previous page. Call it "ticker", and name the variable which will contain the data for the text box "content".

Output image

Format the appearance of the text box, by adjusting the values in the Window -> Panels -> Text Options and Window -> Panels -> Character dialog boxes. I used a white Arial font, size 12, right-aligned.

Output image

Output image

Next, we need to create a motion tween to move the text box horizontally across the bottom of the movie. Insert an instance of the newly-minted "ticker" symbol into your movie clip, outside the lower right edge of your movie clip.

Output image

Insert a new keyframe in your timeline somewhere around frame 40, and move the symbol instance all the way across to the other edge of the movie clip.

Output image

Right-click anywhere between the two keyframes in the timeline and insert a motion tween.

Output image

Test your movie. You should see the symbol instance float horizontally across the bottom of the screen.


Of course, it doesn't contain anything yet - which makes it fairly useless. Let's rectify that next. Right-click the first keyframe and insert some ActionScript.

loadVariablesNum ("http://localhost/ticker.php", 0);

This tells Flash to load variables generated by the server-side script "ticker.php" into the movie, and use them wherever required. Let's look at that script next.

How to do Everything with PHP & MySQL
How to do Everything with PHP & MySQL, the best-selling book by Melonfire, explains how to take full advantage of PHP's built-in support for MySQL and link the results of database queries to Web pages. You'll get full details on PHP programming and MySQL database development, and then you'll learn to use these two cutting-edge technologies together. Easy-to-follow sample applications include a PHP online shopping cart, a MySQL order tracking system, and a PHP/MySQL news publishing system.

Read more, or grab your copy now!

previous page more like this  print this article  next page
In trog...
Logging With PHP
Building A Quick-And-Dirty PHP/MySQL Publishing System
Output Buffering With PHP
Date/Time Processing With PHP
Creating Web Calendars With The PEAR Calendar Class
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
In cut!...
American Chai
The Core
Find out how you can use this article on your own Web site!

Copyright © 1998-2018 Melonfire. All rights reserved
Terms and Conditions | Feedback