Solved

ActionScript text Animation

Posted on 2000-03-01
14
791 Views
Last Modified: 2012-05-04
www.Lunarmedia.com/home.html is a site that boasts that they have figured out how to use actionscript to animate long strings of text and by the looks of the site they must have.  Doing it character by character would be excruciatingly slow.  I'm relatively new to flash and don't know whether or not this is a well kept secret, but I can't find references to this "painless actionscript character animation" anywhere.  Perhaps someone knows of some tutorial links??  I have sent an e-mail to the creator of the Lunarmedia site and am hoping for a response from him as well.  So the question is, how do you animate long strings of characters using actionscript??
0
Comment
Question by:smcdonald
  • 8
  • 5
14 Comments
 
LVL 3

Expert Comment

by:SuperMario
Comment Utility
That looks like a simple loop, which just modifies the _xscale, _yscale, _alpha and other properties of a text clip.

-Dan
0
 
LVL 2

Expert Comment

by:coopa
Comment Utility
> and don't know whether or not this is a well kept secret
I believe it is.

I've been trying to achieve this for a while!

My thoughts:
This would be very difficult to automate as character width is not consistent.
I don't believe there is a way of extracting individual characters from a text variable.

They would have a animation that changed the alpha and scale/rotation of a text variable

Otherwise it goes a litle like this.

IF not End of text file
   IF not end of line
      Position Movie Clip x points to the right of that last letter.
      Read individual character to a variable in the movie clip
   Else
      Position Movie Clip (on begining of next line)
      Read individual character to a variable in the movie clip
   EndIf
ELSE
   Stop
EndIf

This would be an action on the 2 frame of a movie clip that is looping, this way the characters would appear one by one.

To get the different effects they'd just use a different movie for the character.

IF IT'S THE LAST THING I DO... I WILL ACHIEVE THIS !!!
0
 
LVL 7

Expert Comment

by:ssdesign
Comment Utility
I know of the script and not just one but atleast two to three of them with different types of animations.
0
 
LVL 2

Expert Comment

by:coopa
Comment Utility
Well tell us then !

8o)
0
 
LVL 7

Expert Comment

by:ssdesign
Comment Utility
I can give you one for free and rest two can be shared for a charge.
If you want to look at one of the samples then go to my site at http://ssdesign.hypermart.net

The one that i intend to share for free will be posted on this board later in the day.
0
 
LVL 7

Accepted Solution

by:
ssdesign earned 100 total points
Comment Utility
Ok so here it is......... something that all of you have been waiting for.

One of the script i am sharing with you for FREE is in a zip format and it's a excellent text effect using action script.

To get this effect go to the url mentioned below and download the zip file that contains the .fla, .swf and .html files for the above mentiond.

Hope you find it useful.

I have many such effects and if you like the above i can share the other for a price of course.
0
 
LVL 7

Expert Comment

by:ssdesign
Comment Utility
sorry i forgot to write the URL it's http://ssdesign.hypermart.net/text1.zip
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 2

Expert Comment

by:coopa
Comment Utility
I'd forgotten how much I hated reading other people's code.

Still... Nice effect, I like it.
0
 
LVL 2

Expert Comment

by:coopa
Comment Utility
Okay I don't know about smcdonald but I think it's impossible to work this out unless you give more details.

For example Variable descriptions.
string_leng
k_main
l_main
ops
m_main
alone

And some pseudo code would be useful.
If you are in this for the points then i can post some.

Oh and one more thing.... Why does the movie contain the flashplanet logo ?
hmmm ?

Oh now I see....  You got this off FlashPlanet.com... from their open source section.

Does that mean you don't know how/why it works ?

Bummer !
0
 
LVL 2

Expert Comment

by:coopa
Comment Utility

I gave up on that example and pretty much worked this out on my own...

I used my own pseudo code (above near top) to produce a small movie with an animated sentence... based on the 'Duplicate movie clip' function.

I found that you can read a variable 1 character at a time using:
Substring ( textline, Lnum, 1 )

Where Lnum is the position of the character in the sentence.

So with a sentence like 'hello world'
Substring ( textline, 2, 1 )
would return 'e'

Easy huh !  You just loop through the sentence incrementing Lnum.

In my original post i put:
> This would be very difficult to automate as character width is not consistent.

This is still a problem... the only way around this as far as i can see is to set some rules;

like if the character is 'l or i or j or ; or , or . '
then only move right slightly,
if it's a 'o or h or e or t etc.'
then move on slightly more and if
it's a 'W or M etc' then move on the most.

This is a pain in the arse and if any one as a better solution i'm listening !!

I will post my example with full pseudo code soon.

Rich.
0
 
LVL 2

Expert Comment

by:coopa
Comment Utility
LETTER WIDTH CODE:
Found this in that example... It's for working out text widths...

      If ((cr eq "i") or (cr eq "j") or (cr eq "l") or (cr eq "I") or (cr eq ".") or (cr eq",") or (cr eq ";") or (cr eq":") or (cr eq " "))
            Set Variable: "siz" = "54"
      Else If ((cr eq "f") or (cr eq "r") or (cr eq "t") or (cr eq "!"))
            Set Variable: "siz" = "61"
      Else If ((cr eq "s") or (cr eq "z") or (cr eq "?") or (cr eq "c"))
            Set Variable: "siz" = "75"
      Else If ((cr eq "B") or (cr  eq "P") or (cr  eq "R") or (cr  eq "S") )
            Set Variable: "siz" = "104"
      Else If ((cr  eq "H") or (cr  eq "C") or (cr  eq "K") or (cr  eq "V") or (cr  eq "Y"))
            Set Variable: "siz" = "115"
      Else If ((cr eq "A") or (cr  eq "D") or (cr  eq "G") or (cr  eq "N") or (cr  eq "O") or (cr  eq "Q") or (cr eq "U") or (cr  eq "X")or (cr  eq "ø")  or (cr  eq "ì")  or (cr  eq "û")  or (cr  eq "þ")  or (cr  eq "ô")  or (cr  eq "æ")  or (cr  eq "ù") )
            Set Variable: "size" = "130"
      Else If ((cr  eq "w") or (cr  eq "m")or (cr  eq "Ô")  or (cr  eq "Ö")  or (cr  eq "Æ")  or (cr  eq "Ý")  or (cr  eq "Ø")  or (cr  eq "Ì")  or (cr  eq "ß")  or (cr  eq "Ä")  or (cr  eq "Þ")  or (cr  eq "Ó")    )
            Set Variable: "size" = "150"
      Else If ((cr  eq "M") or (cr  eq "W"))
            Set Variable: "siz" = "170"
      Else
            Set Variable: "siz" = "90"
      End If
0
 
LVL 2

Expert Comment

by:coopa
Comment Utility
here is the result.

www.coopa.demon.co.uk/ee/funky.html

I'm pretty prowd of this !!

Rich

P.S.  Obviously this is just a test so the interface is crap.
0
 
LVL 7

Expert Comment

by:ssdesign
Comment Utility
coopa that script basically relies on the one i had posted. So do you think i should be getting some points at this stage?........ :)
0
 
LVL 2

Expert Comment

by:coopa
Comment Utility
You mean for the script you downloaded from FlashPlanet.com ?  You already got the points by the look of it...  

I'm not in this for the points.  I was genuinely interested in getting that effect to work.

The only bit I used was the code to space the letters correctly, the rest is my own work.

Congrats.

Rich.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Stock Videos 17 318
Embedded Video Download (Flash) 3 1,130
Running Mp4 or Flash Video 1 81
HTML 5 video and audio or Flash 1 28
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now