A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Matix randomcode

  1. #1
    Member
    Join Date
    Oct 2001
    Posts
    30

    Post

    Hi all

    Please can someone help me I need to know how to do the matrix randomcode numbers movie inside a word

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Is this where you have a random jumble of numbers in the shape of a word?
    if so try this. Create a solid block of colour (to act as a mask) and on the same layer type the word you want. Select this word and break it apart, then you can use these letters as a cookie cutter. When you delete them they should leave a cut out of their shape in your masking layer.
    Create a new layer below this one and insert a new movie clip with a few frames of numbers flashing etc.

  3. #3
    Member
    Join Date
    Oct 2001
    Posts
    30

    Post matrix

    Inside of the letters is where the number move ramdomly from left to right or from top to bottom is what I mean

    Thanks

    Mike

  4. #4
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Thought so, In that case creating a mask in the way described above should work fine. You can then create some movie clips which could contain textboxes with random variables (Made using Math.random() ) You can then animate these behind the mask layer so they appear to be in the letters.

  5. #5
    Member
    Join Date
    Oct 2001
    Posts
    30

    Post Matrix

    What do you mean when you sat Math.Randon (() please xplain.

    Thanks

    Mike

  6. #6
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    For example in frame 1 create a dynamic textbox with the variable name rand and a button. Then in frame 2 add the action gotoAndPlay(1);
    Add the following code to the button.
    Code:
    on (release) {
    rand = Math.random();
    }
    When you click the button you'll see it comes out with a random number (between 0 and 1) you can then use this random number to make other numbers e.g.
    Code:
    rand1 = Math.random() * 4000; // a random number 0 to 4000
    rand2 = (Math.random() - 0.5) * 4000; // a random number from -2000 to 2000
    You can chop off all the numbers after the decimal place by using

    Math.floor(Math.random() * 30);

    or round to the nearest whole number with

    Math.round(Math.random() * 900);

    although to get the effect you're looking for it maybe better to leave the decimal part as it is.

  7. #7
    Heres what you do, first you make 2 layers, name one ACTION SCRIPT and the other LetterMovieAnimator-Movie insert a keyframe in frame 1 create a keyframe and put the Count = 0;
    action in it, now in frame 2 add a keyframe in the LetterMovie layer on the Action Script layer add

    duplicateMovieClip ("line", "line" add Count, Number(Count)+1);
    setProperty ("line" add Count, _x, random(Number(Count)+400));
    setProperty ("line" add Count, _y, random(Number(Count)+50));

    then on frame six add the code to ur action script layer

    if (Number(Count)<=7) {
    Count = Number(Count)+1;
    gotoAndPlay ("LineCounter");
    } else {
    Count = 1;
    }
    and it should work

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