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/Basic

Categories How to make a scrolling bitstream?
Author: J. van Raak

 
Page 2
«prev 1 2 3 next»

Now I can explain how we are going to make this work. If the movie starts we are going to fill the textboxes with the bits. We do this by setting the variables _root.BitLine0..9, then we are going to scroll the movie down until the top text is reaching the top of our window. If this is the case we must set our movie back to the original position, and swap bits from the first 5 lines to the last 5 lines. On the first 5 lines we can create some new random bits. So there will scroll an endless stream of bits down. Got it?
Anyway, it will become clearer during the progress of creating the rest of our movie.

Select Layer 1 and choose Modify->Convert to Symbol. Name it BitField and choose for bahavior Movie clip.

Now we are going to add some actions to our movieclip. Rename Layer 1 to 'BitField' and create a new layer 'Actions' and copy the following code in your Actions Layer:
function MakeBitLine() {
 var s = ''
 for (i=0; i<15; i++) {
 s += Math.round(random(2))
 }
 return s
}
function FillBitField() {
 BitLine0 = MakeBitLine()
 BitLine1 = MakeBitLine()
 BitLine2 = MakeBitLine()
 BitLine3 = MakeBitLine()
 BitLine4 = MakeBitLine()
 BitLine5 = MakeBitLine()
 BitLine6 = MakeBitLine()
 BitLine7 = MakeBitLine()
 BitLine8 = MakeBitLine()
 BitLine9 = MakeBitLine()
}
function SwapBitField() {
 BitLine5 = BitLine0
 BitLine6 = BitLine1
 BitLine7 = BitLine2
 BitLine8 = BitLine3
 BitLine9 = BitLine4
 BitLine0 = MakeBitLine()
 BitLine1 = MakeBitLine()
 BitLine2 = MakeBitLine()
 BitLine3 = MakeBitLine()
 BitLine4 = MakeBitLine()
}
In the function MakeBitLine() we return a random string of zeros and ones. This string is 15 characters long, because 15 characters fills the width of the window.

The function FillBitField() we only need when we load our movie, it just fills the ten variables of our textboxes with random bits using the MakeBitLine() function.

The function SwapBitField() we use when our movie is moving back to its original top position. We must set the bottom 5 lines to the top 5 lines to let the scroll move on where it was. We create new bits on the 5 top lines that are positioned outside the window.

Now the only thing left to do, is to let the BitField movieclip scroll down and move up again. Select the BitField movieclip and give it these actions:
onClipEvent(load) {
 _root.FillBitField()
}
onClipEvent(enterFrame) {
 _y += 10
 if (_y == 90) {
 _root.SwapBitField()
 _y = 0
 }
}
When our movie loads we call the function FillBitField(). In the main loop of our movie we set the _y position every time 10 pixels up. You can make this 1 if you want a slower scroller or 30 if you want a faster scroller. If the _y position of our movie is 90 we must swap the bits and set _y back to the original position.

«prev 1 2 3 next»

» Level Intermediate

Added: : 2004-11-05
Rating: 5.57 Votes: 7
Hits: 1867
» Author
Not much to tell ya!
» Download
Download the files used in this tutorial.
Download (172 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