Solved

ActionScript text Animation

Posted on 2000-03-01
14
796 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
14 Comments
 
LVL 3

Expert Comment

by:SuperMario
ID: 2575114
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
ID: 2616393
> 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
ID: 2729446
I know of the script and not just one but atleast two to three of them with different types of animations.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 2

Expert Comment

by:coopa
ID: 2729663
Well tell us then !

8o)
0
 
LVL 7

Expert Comment

by:ssdesign
ID: 2729759
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
ID: 2730238
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
ID: 2730250
sorry i forgot to write the URL it's http://ssdesign.hypermart.net/text1.zip
0
 
LVL 2

Expert Comment

by:coopa
ID: 2730349
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
ID: 2730630
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
ID: 2734049

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
ID: 2734159
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
ID: 2734498
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
ID: 2734710
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
ID: 2734799
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error 2032 in all the browser 6 2,896
Adobe Presenter not Publishing Slide Theme 17 135
File drag and drop 6 158
Running Mp4 or Flash Video 1 148
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…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
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 how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

737 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