A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11303 Flash Movies | 7 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Nitin Tikhe
» Title: Cart
» Description: This Animation Tut is a fun and useful for kids below 15 years. Watch the Flag, Doors, Stick and Horse movements.
» More by Nitin Tikhe


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

Featured Site

» Posted in the Flash Kit Links section
» Title: Banana Swimwear
» Description: This is a banana swim wear interactive catalog we designed and animated in Flash


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

» Make flash video player for broadcasting live streaming video / TV on website
» How to convert the project file of Flash Demo Builder 2.0 into FLV file
» FLV to PSP for Mac - How to convert YouTube video to PSP on mac
» How to Convert FLV to MP4 for Playback on iPod
» how to download and convert youtube video to AVI with Leawo Free FLV converter
» Flash Multi-player Game Tutorial - TicTacToe
» How to make Flash elearning tutorials with screen recorder?
» Fader API:Slideshow with MovieClips on stage
» How to convert MS PPT file into an FLV File
» Unknown Tag: Title10
Random Tutorial | Add Site

Network Design Manager
The Computer Merchant, Ltd
US-VA-Hampton

Justtechjobs.com Post A Job | Post A Resume


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: 1863
» 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