Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4941 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


Random Links | Add your own Flash Related Links
Flash Tutorials 1481 Tutorials 7 New Tutorials Added!
What's New | Top100

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Actionscripting

Categories Creating Random Quotes for Flash
Author: Bjern Potgieter | Website: http://photoguide.4t.com |

 
Page 1
1

Create a new flash movie, set everything up as you like it. At the same time create a text file with all your quotes in it but something like this... You can even copy this code for the mean time to get the idea.

 quote0txt=The+scenery+never+changes+if+you're+not+the+lead+dog
quote1txt=Every+dog+has+it's+day
quote2txt=Commitment+is+the+igniter+of+momentum
quote3txt=Don't+miss+the+magic+of+the+moment+by+focusing+on+what's+to+come
quote4txt=Enthusiasm+generates+success+and+breeds+excellence

Paste the above text in our special Flash Variables Translator and convert it from 'English to Flash'. What appears in the bottom is what flash understands and reads. Copy this text junk to your quotes text file and save it as 'quotes.txt'. What you hav done now is set up an external file that Flash loads when it is run. So if you upload new quotes every now and then great, at least you don't have to redesign your Flash movie.

Somewhere in your movies load up you need to add the folowing action in the action panel... loadVariablesNum ("quotes.txt", 0); This loads the variables you've just created and saved. The next step is to create a dynamic text box (I'm assuming you now what that is - if not refer to the Dreamweaver help). Name your text box like I have as 'myquote'. Now wherever you want your quote to appear you need to insert the following actionscript:

newquote = random(numQuotes);
_root.myquote = eval("quote" +newquote+ "txt");

Explanation: You're creating a variable called 'newquote' which random chooses a number between 0 and 'numQuotes'. then going to 'myquote' text box fill in the randomly chosen quote. To see an example of this visit the Home page. Although there I have used a mouseover effect that displays a different quote every time. The options are unlimited.

1

» Level Intermediate

Added: : 2001-04-23
Rating: 5.83 Votes: 72
Hits: 7571
» Author
I design web sites for a little pocket money and for the learning experience. I like to share what I've learnt with others...
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments