Star Wars intro text effect with fp10 in 14 lines of code

I finally installed flash CS4, and the first thing I had to do was recreate "the intro". This is practically guaranteed to make you cry 25 years from now! I once again I proclaim my absolute joy of having the 3d features in as3 :D


If you see nada, it's not because I'm lying about this superhuman feat of engineering ;) but because you don't gots teh flash player 10. It's interesting to see the flicker once you let the sucker scroll for a while... I guess some mask or so might sort that out...

Actionscript:
  1. var rotated_holder:Sprite=new Sprite();
  2. rotated_holder.y=360;
  3. rotated_holder.rotationX=-70;
  4. var text_field:TextField=new TextField();
  5. text_field.width=480;
  6. text_field.multiline=true;
  7. text_field.wordWrap=true;
  8. text_field.autoSize=TextFieldAutoSize.LEFT;
  9. var text_format:TextFormat=new TextFormat("Arial",42,0xE3EF7D,true,null,null,null,null,TextFormatAlign.JUSTIFY);
  10. text_field.text="It is a period of civil war. Rebel [REST OF TEXT HERE]....";
  11. text_field.setTextFormat(text_format);
  12. rotated_holder.addChild(text_field);
  13. addChild(rotated_holder);
  14. addEventListener(Event.ENTER_FRAME,function(e:Event):void{text_field.y-=1;});

nifty no? About 6 lines into this though, I realized it could be even quicker done just by plain old motion tweening :D (which I incidentally also find cool, you know, that that's possible).

Tags: , , ,

9 Responses to “Star Wars intro text effect with fp10 in 14 lines of code”

  1. bart Says:

    Needs the sound ripped from this: http://www.youtube.com/watch?v=A7tJiu4fhLc

    FOR JUSTICE

  2. Diego Says:

    1119: Access of possibly undefined property rotationX through a reference with static type flash.display:Sprite.

    pls help T_T

  3. sakri Says:

    Hi Diego, you’ll need to update your flashplayer to the new version, which is currently at 10.0.12.36 get it here : http://get.adobe.com/flashplayer/

  4. Lea Says:

    Is it possible to include images in there? to scroll away with the text?

  5. sakri Says:

    Hi Lea,

    Sure, the flashplayer10 3D is often called “postcard 3d”, so you can basically put whatever you want on a “plane” and then rotate and manipulate its position.

    To place images in text, you’ll need to look into the flash text engine, or the TextLayoutFramework.

  6. Geeem Says:

    Thanks for this, it has the potential to resolve a problem I’m having. I’m using AS3 to slide text onto the stage in 3D but I can’t get the equivalent of Local Transform (which you’d need if doing it with tweening). I just can’t see how your code works. If I manually add a text mc to the stage and adjust rotationX to -70, then start changing Y, all that happpens is the text moves vertically up the stage, but doesn’t move away from you! So how does your code do it?!
    BTW I’ve been trying to use Tween script…
    var move1:Tween = new Tween(words_mc,”x”,Strong.easeOut,-215,400,2,true)….etc

    Thanks!

  7. sakri Says:

    The textfield is inside another sprite. The sprite is rotated, after that, just adjust the nested text field. :)

  8. Geeem Says:

    Thanks for your help

  9. Simon Says:

    great script – simple and effective!

Leave a Reply