6 Replies Latest reply on Feb 21, 2011 12:24 PM by Ned Murphy

    Matrix Code Tutorial Help Needed - Symbols wont change

    Bonjour_Rodney Level 1

      Please could someone help me out with this Flash problem, I would really appreciate it.

       

      I have followed the guide at this link to create a matrix code effect. The matrix code font file is available to download from this site also (mCode15).

      Once I get this file up and running and understand how it works, I'm going to tweak it somewhat to suit my needs.

       

      I  am, however, experiencing some problems getting it to work as described  in the tutorial. I have followed the tutorial to the letter, but when  the flash movie file runs, only the glyph symbol that I used to create the_one and one_pod movie symbols is displayed in the code that scrolls  down screen. I have embedded the font the way it describes and even  added it to the library and set it to export for actionscript using the  linkage option. But the matrix code that rains down is still only one  symbol which never changes.

       

      Please please help me out with  this as I'm slowly losing my sanity trying to figure it out. I am using  Flash CS3 on a Windows 7 PC to do this and the file is set up up as action script  2.0.


      Many thanks for any help you can provide.

      The Action Script code from the site is included below, this is pasted into the 1st frame.



      // ---------------------------------------------
      // The Flash Matrix - www.pixelhivedesign.com
      // ---------------------------------------------
      // Initialize variables.
      maxLines = 25// Maximum number of lines at once.
      minScale = 10// Minimum scale of a line.
      maxScale = 100; // Maximum scale of a line.
      // Create an empty Movieclip to hold the Matrix.
      theMatrix = createEmptyMovieClip('MatrixCode',1);
      curLines = 0; // Keeps track of the current number of lines.
      // ----------------------
      // Generating the Matrix.
      // ----------------------
      theMatrix.onEnterFrame = function(){
      // Check that the current number of lines is less than the maximum allowed.
      if(curLines <= maxLines){
      curLines++;  // Increment the number of lines.
      // Create a new line.
      codeLine   = this.createEmptyMovieClip('codeLine',curLines);
      // Generate a random scale for the line.
      // This simulates lines at different distances.
      var ranScale  = Math.round(Math.random() * (maxScale-minScale)) + minScale;
      codeLine._xscale = codeLine._yscale = ranScale;
      // Position the line at a random X location.
      codeLine._x = Math.random() * Stage.width;
      // Determine line speed based on the distance.
      codeLine.speed = (codeLine._xscale)/10;
      // ---------------------------------------------
      // Creating a line of multiple pods (characters)
      // ---------------------------------------------
      codeLine.myCodes = []; // Array to store individual pods.
      numPods = 0;       // Number of pods.
      while(codeLine._height < Stage.height){
      numPods++;  // Increment the number of pods.
      // Attach a single pod to the line of code.
      pod = codeLine.attachMovie('one_pod','pod'+numPods,numPods);
      codeLine.myCodes.push(pod);   // store pod.
      // Position pod above the last one (vertical lines)
      pod._y -= (pod._height+2) * numPods;
      // Choose a random Matrix character.
      // Character Codes for lower case letters are between 96 & 123
      pod.the_one.Neo.text = chr(Math.round(Math.random() * 27) + 96);
      }
      // ----------------------------
      // Initialize the white pulse.
      // ----------------------------
      // Store pod position to start at.
      codeLine.ind = 0;
      // Store delay between pulses.
      codeLine.delay = codeLines.myCodes.length;
      // ------------------------------------
      // Animating each line of code.
      // ------------------------------------
      codeLine.onEnterFrame = function(){
      // -------------------------------
      // Vertical animation of the line.
      // -------------------------------
      // Every frame make the line move down by it's speed.
      this._y += this.speed;
      // Check if the line of code has animated off the Stage
      if(this._y - this._height >= Stage.height) {
      // Yes, so allow an additional line to be generated.
      maxLines++;
      // Remove this line and free memory.
      this.removeMovieClip();
      }
      // ----------------------------
      // Animating the white pulse.
      // ----------------------------
      // Get next pod to affect.
      this.curCode = this.myCodes[this.ind];
      // If the pod is not currently animating, start its animation.
      if(this.curCode._currentframe == 1) this.curCode.play();
      // Check if we have reached the end of the line.
      if(this.ind < this.myCodes.length and this.delay != 0){
      // No, then move on to next character.
      this.ind++;
      // Decrease the delay before next pulse.
      this.delay--;
      } else {
      // Yes, then reset the character position.
      this.ind = 0;
      // Reset the delay before next pulse.
      this.delay = this.myCodes.length;
      }
      }
      }
      }