PDA

View Full Version : scrolling marquee eg. dot matrix readerboard


Ming0
09-30-2003, 11:37 PM
I am VERY inexperienced with both flash and actionscript--however, I have a personal project that I need to make a dynamic LCD screen for...


So I am trying to make a dot matrix that would scroll the text that a person could type into a field.

If anyone knows where I could find some code (actionscript or not) having to do with dot matricies, I would appreciate.

Also if anyone has any advice on where I should begin or any tips, I am all ears.

On the following site, I stumbled upon the look I want, but I don't know if theirs is dynamic or if it is hard coded to only say one phrase. You may need to reload the page a few times, because the example is an ad for ebay--it has a walkman controller with an LCD screen on it.

http://www.nme.com/artists/artist.htm?ID=100614


Thanks in advance,

Dean

Xenozip
10-01-2003, 01:22 AM
I'm not sure what a dot matrix is.. It's like a really ancient printer technology, isn't it?

I might be able to help with a scrolling marquee, though.

One way to do it would be to mask two dynamic text boxes, and have the script move both the text boxes left and/or right. Or if you're trying to avoid scripting, you could make it a motion tween.

Then the input text field would define what the dynamic text boxes say. Is that what you're trying to do?

I'm not sure what a dot matrix is though..

Oh.. hehe, If by "dot matrix" you mean the text appears pixelated, then you could just make the mask a grid.

Need more information on what you're trying to do before giving detailed advice.

spriggan
10-01-2003, 02:08 AM
Originally posted by Xenozip
I'm not sure what a dot matrix is.. It's like a really ancient printer technology, isn't it?

*Spriggan feels realy old*

another way would to make a componet or something that would read the text in and break it up by character. Then instead of showing a standard 'a','b',or 'c' it would attach a movie clip that would be the letter that you drew.

Or if you want to do it the way it was probaly done, download a TT font that looks like that.

Xenozip
10-01-2003, 04:54 AM
Originally posted by spriggan
*Spriggan feels realy old* Hehe, I'm not that young. I'll be 22 in 3 months time.

By ancient, I meant that it's been outdated in the world of technological advances at least a hundred times over by now (what, with laser printing and all).

Ming0
10-01-2003, 01:01 PM
Ok to clarify,

a dot matrix is a grid of dots--one can specify if a single dot is in the on or off position--then all that is needed is a code to represent each individual number and letter that will turn the proper dots on/off and a piece of code to make all the dots scroll in unison.

I can figure out the code for on/off and scrolling later--my biggest problem is that I don't really know the most efficient way to make a dot in the matrix turn on and off (in actionscript/flash)....

So if I can figure out an efficient way to solve the following hypothetical problem, I will be in business:

...
...

So let's say that the six dots above is our dot matrix, and I just want to be able to do the following things:

make every other dot be in the "on" position (so one "on" in top middle, and two "on" in bottom row--one on each corner), and then flip all the bits so that the "on's" became "off's" and vica versa.

And--make one "on" dot scroll through both rows.

At a glace, what is the easiest way to make this happen. The dots can be anything, little red squares, or something else if there seems to be another way to do it?

hope this helps, let me know if you need any descriptions--and sorry to use silly jargon ;)

Thanks for Help!,

Dean

dzy2566
10-01-2003, 02:39 PM
Sounds like it would be similar to building the map for a tile based game. Take a look at some of the turorials on moxicode (http://oos.moxiecode.com) I think you'll be able to modify this concept to fit your needs.

This experiment (http://downloads.junioronline.us/details.php?section=2&item=28) on juiorOnline might also give you some insight.

dzy2566
10-01-2003, 03:27 PM
I think this is probably what you were looking for. flashKit's dot matrix example (http://www.flashkit.com/movies/Scripting/Dot_Matr-Shakib-4210/index.php)

Xenozip
10-01-2003, 05:31 PM
Bingo, bingo!

But, I still think spriggians idea of just using a custom dot matrix font is a heck of a lot more effecient. :|

dzy2566
10-01-2003, 06:17 PM
You're probably right. I was just throwing out stuff that I had come across.

Ming0
10-01-2003, 08:27 PM
COOL!!!

Thanks a bunch for the link... This is exactly what I was looking for! So my plan is to have a database of different quotes to dip into, so that every time that someone mouses over an element, something different--yet still related scrolls across the lcd...

Thanks again for the help guys (and gals if there are any)

--Dean

Xenozip
10-01-2003, 11:04 PM
Originally posted by Ming0
COOL!!!

Thanks a bunch for the link... This is exactly what I was looking for! So my plan is to have a database of different quotes to dip into, so that every time that someone mouses over an element, something different--yet still related scrolls across the lcd...

Thanks again for the help guys (and gals if there are any)

--Dean I still don't understand why you'd want to create a dot matrix entirely out of action script, though. Unless you were worried about copyright laws or something..

If you just used a dot matrix look-a-like font, then it would essentially be accomplishing the same thing, only with a heck of a lot less action script.

Ming0
10-01-2003, 11:33 PM
I bet that you are right... I still am not sure how to go about the dynamic text deal... so let me just describe exactly what I am attempting to do, and you can tell me if you think that the rendered text would be viable--because if I could do it the way you describe above (which I still don't fully understand), it would be easier.

So I have a picture of a bundle of dynamite conected to an LCD screen (like caller ID style). Below the dynamite are five different icons. When a person mouses over an icon, the title of the page scrolls across the LCD. For example--"roll your own"

after the title goes across, as long as the cursor doesn't roll over any other icons, I would like the LCD screen to fetch a random saying from the "roll your own" database that further describes the section--"the chopper demystified" (it is a bicycle chopper site--and the roll your own section is about how to composite a chopper)

So for each section of the site, I would like to have a database of 20 to 30 different sentence long descriptors. (I will be using MySQL)

Does this still sound plausible?

Right now I am just looking to get a basic LCD screen that will print whatever I want it to--without having to do more than re-hard code the action script. (i.e. I don't want to have to change the graphics--just the code)

Sorry if this is an odd problem--I just figured that you can do most anything with flash...

Xenozip
10-02-2003, 01:47 AM
Ok, here is what I would do :

I don't know if this is the most effecient way of doing it, but this is all I can think of for now :

Create a movie clip and give it the instance name of "Text_holder"
Inside the movieclip, create two dynamic textboxs
give *both* of them the variable of "Description_Box"
Now, create a mask the size that you want the LCD screen to be and place it where you want it to be.

This next part might be a little tricky to explain, but I'll try :

Create a motion tween for the "Text_holder" movie clip so that it starts out in the first frame off to the right of the mask. Tween it so that after a 'set' (for this example, I will use 10 frames) ammount of frames, half of the movie clip is directly under the mask (so that the first dynamic text box is showing through the mask, and not the second one).

Next, continue the tween where the "Text_holder" movie clip continues moving right untill the other half of the clip is under the mask after a 'set' (again, for this example I'll use frame 20) ammount of frames. In the last frame, tell the clip to gotoAndPlay(10); so that it loops back to the halfway mark.

Now, you say you're using icons that you want to manipulate the read-out. So, here's what you do (assuming you're using buttons for the icons -- if you're using MCs just change the syntax) :

on (rollOver, dragOver) {
_root.Text_holder.Description_Box = "Roll your own. "
}

Now you have a scrolling marquee.
The next step would be to find and download a windows true-type font that mimics a dot matrix style, and change the dynamic text boxes that you created to use the new font.

The next step would be to code in the random quote generator.
If I were you, I would have all the quotes in one external file, and set each quote to a different variable, then have flash pick the variable to use randomly from the external file.

To do that, I would do somehting like :

loadVariablesNum("AllQuotes.txt", 0);

// This should generate a random number between 0 and 173
GrabQuote = function(Button1) {
var r = Math.random()*174;// 174 = number of quotes
r = Math.floor(r);
var fStr = q+r;
_root.Text_holder.Description_Box = fStr

// Button actions
on (rollOver, dragOver) {
_root.GrabQuote1();
}

Then create the AllQuotes.txt and place the quotes in numerical order from 0 to 173
like :
q0= Something about choppers
q1= Something else about choppers
q2= Funny quote about choppers
q3= Info about choppers
q173= That's a lot of quotes about choppers!

etc

The dynamic text boxes you created could then be blank to start with (so it appears that there's nothing there). Then when some one scrolls over Button1 flash *should* call the function from the main timeline called "GrabQuote", which tells the dynamic text boxes (both of them) that they are filled with "fStr", which will be a random variable selected from an external text file.

You could probably simplifiy things a lot by using the "which" function and stuff like that, but you get the idea.
That *should* work (pretty sure it will).

The only problem I can see by doing it this way as apposed to a dot matrix script is that if the quotes happen to vary in length dramatically, then that might cause a problem...

Also, in order to get the animation to look like the LCD screen is actually dot matrix and not just a bunch of animated dots, you would need to set each frame of the tween by hand (or using a script), so that when the text moves, the next dot will move over top of the previous one, and so on.

Let us know if you try this method out. I would like to know. :)

Good luck with whichever method you use!

Ming0
10-02-2003, 05:05 AM
right-0

thanks fer the advice... it will take me a while to get this right, and I am sure I will need to ask some more questions, but thanks for pointing me in the right direction.

--Dean