Solved

Exactly what do I need and where do I need it for this Action Script to work.

Posted on 2007-11-18
3
160 Views
Last Modified: 2010-04-03
I am a pretty decent flash designer, but I have always avoided Action Script because manuals don't spoonfeed enough for me to even get started.  So now I'm just going to dive in the only way that ever works for me, which is EE!

I got this AS from another question and if I could see it work I would then at least know what questions to ask on EE to start to understand it.

So please, exactly what do I need in the way of movie clips and other elements for it to work? For example,  what kind of movie is "Letter"? A movie clip? An AVI/   Is there a difference between "Letter" and "letter"?  Is MC_point a movie clip or an instance of a movie clip o both?  ?  Where should it be?
Does this action script go in a frame? What frame? etc., etc. You can't dumb it down too much for me!

Here's te link to the original question: http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_21649018.html

Thanks!
John
MC_point.onLoad = function() {
      // constants
      textStr = "Teach Yourself ActionScript!";
      letterSpacing = 16; // how far apart the letters are
      startX = 50; // horizontal position of leftmost letter
      startY = 200; // vertical position of letters
      startScale = 600; // how big the letters start
      scaleStep = 50; // how much the letters shrink per frame
 
      // create all movie clips
      for (i=0;i<textStr.length;i++) {
            this._parent.attachMovie("Letter","Letter"+i,i);
 
            // fill with letter
            this._parent["letter"+i].letterText = textStr.charAt(i);
            // move off screen
            this._parent["letter"+i]._x = -100;
      }
 
      // init variables
      letterNum = -1;
      scale = 100;
}
 
MC_point.onEnterFrame = function() {
      // if scale is 100, then time for next character
      if (scale == 100) {
            letterNum++;
            
            if (letterNum >= textStr.length)
            {
                  trace("No more loose end...  Good bye!!!");
                  delete this.onEnterFrame;
            }
            // set position of next character
            this._parent["letter"+letterNum]._x = startX + letterNum*letterSpacing;
            this._parent["letter"+letterNum]._y = startY;
 
            // set to largest size
            scale = startScale;
      }
 
      // make a little smaller
      scale -= scaleStep;
      this._parent["letter"+letterNum]._xscale = scale;
      this._parent["letter"+letterNum]._yscale = scale;
      
      trace("letterNum = " + letterNum + "   textStr.length = " + textStr.length);
}

Open in new window

0
Comment
Question by:gabrielPennyback
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 20310485
Hi there John, MC_Point will be the instance name of a movieclip.
difference between Letter and letter - yes Flash AS is case sensitive.
this code can go on the timeline where the movieclip resides.
also the parent of this clip (assuming the root) - has a bunch of clips as well, letter1, letter2 etc.
hope that helps.
0
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 20310588
hey blue-genie, I'll get back to you with more questions I'm sure tomorrow when I get a chance to spend some more time with it.  Thanks for getting my started,

John
0
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 20344546
Hi blue-genie,

OK, my flash file has one layer and one frame. On that frame  I have named the instance of my MC "MC_Point". I have put the code in that frame. I'm afraid that now I need the next 3 or 17 steps/elemnts spelled out exactly for me to see anything happen!

Thanks!
John
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Firefox fullscreen video lags 4 163
Script to Delete registry entry based on Product name 6 162
Adobe Flash player - Microsoft Edge 9 168
Adobe Indesign CS6 4 120
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question