A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Matrix style counting

  1. #1

    Smile

    Hi I want to make a matrix style counting movieclip.
    So that the numbers begin at 1 till and as example end at 250.000.000. and I want that the numbers counting up very fast. Is this possible???


    Thanks in advance,

    Wessel

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Location
    Raleigh, NC
    Posts
    419
    I'm assuming you are refuering to the movie Matrix. If you are, set your frame rate to something pretty fast (like 24 or so) and then try the following code.

    onClipEvent(load){
    number = 0 <-- you can also make this
    random with math.random()
    }
    onClipEvent(enterFrame){
    lable = number+1 <-- you could also make this a
    variable assigned
    a random number
    }

    attach this code to a movie clip with a text field controlled by a varible named 'lable'.

    Also ... you can creat a falling effect by decrementing another varible in the onClipEvent(enterFrame) function. Use that variable to position the text field.

    I hope this helps.

    I have also posted a thread regarding custom components. If you know anything about the subject please reply.


  3. #3
    No i haven't heard or read about your post, where can i find it??

    Anyway i've tried the actions , i've used these:

    onClipEvent (load) {
    number = 5;
    }
    onClipEvent (enterFrame) {
    lable = number+1;
    }

    but when I want to test the movie it gives this syntax error:

    **Warning** Scene=Scene 1, Layer=Layer 1, Frame=1: Line 2: Case-insensitive identifier 'number' will obscure built-in object 'Number'.
    number = 5;

    So if you can help me with this thanks and how can i drop the numbers down like in the matrix movie???


    Thanks in advance,

    Wessel

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    336
    just jumping in here.. looks like that error you getting is because "number" is a built-in object in Flash.

    change the variable to something like "num" or "startNum" instead and it will probably get rid of that error messages.

  5. #5
    Senior Member
    Join Date
    Apr 2002
    Location
    Raleigh, NC
    Posts
    419

    Movie properties

    final_eternity has the variable thing right. I did not realize that 'number' is an inherent object. Oops...

    To make the numbers drop you will need to define some properties for the movieclip with the text field in it. Attach to the movieclip the following code:

    onClipEvent(enterFrame){
    this._y=this._y-dropRate;
    }

    'dropRate' is a variable which will determine how fast the number will fall. This can also be randomly assigned. Make sure the movieclip with the text field in its' linkage properties to export. Give it a name you will remember. Then you need to make another movie and place code on it to attach those movie clips. You can set x and y positions for the new movies. If you feel really inventive, you can make the rate of fall random, the x position set to some increment so that you will get straight columns of numbers. Play with it for a while and let me know how it comes out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center