A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Star wars crawl - text scroller

  1. #1
    Senior Member
    Join Date
    Apr 2004
    Posts
    132

    Star wars crawl - text scroller

    I have flash CS4 and I understand that you can "easily" replicate the star wars text scroll effect with the 3d tools.

    http://www.creativepro.com/article/c...ing-text-flash

    I have followed that tutorial to the best of my ability but no matter what I do, I cannot get the text to scroll into the distance, it just moves upwards.

    Could some kind soul create a basic scroller for me so I can look at the example and learn from it.

    Thanks ever so much

    A frustrated Koit.

  2. #2
    Senior Member
    Join Date
    Apr 2004
    Posts
    132
    Anyone please ?

  3. #3
    Senior Member
    Join Date
    Apr 2004
    Posts
    132
    Please see the following link for my example - this is all I'm getting, can someone please help !!

    http://www.highasakoit.co.uk/temp/attempt.fla

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    What player version are you publishing for?

  5. #5
    Senior Member
    Join Date
    Apr 2004
    Posts
    132
    10, using CS4.

  6. #6
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    That seems right enough at least. I don't have the flash IDE so that tutorial and your fla are useless to me to try to reproduce your problem. I'm going to try to see if I can whip something up.

  7. #7
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Here you go. No charge.
    Code:
    package 
    {
    	import flash.display.Bitmap;
    	import flash.display.BitmapData;
    	import flash.display.Graphics;
    	import flash.display.Sprite;
    	import flash.events.Event;
    	import flash.text.TextField;
    	import flash.text.TextFieldAutoSize;
    	
    	public class Main extends Sprite 
    	{
    		private var textContent:String = "Lorem ipsum \n"+
    		"dolor sit amet, consectetuer adipiscing elit. Aenean " +
    		"commodo ligula eget dolor. Aenean massa. Cum sociis " +
    		"natoque penatibus et magnis dis parturient montes, nascetur " +
    		"ridiculus mus. Donec quam felis, ultricies nec, pellentesque " +
    		"eu, pretium quis, sem. Nulla consequat massa quis enim. " +
    		"Donec pede justo, fringilla vel, aliquet nec, vulputate eget, " +
    		"arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, " +
    		"justo. Nullam dictum felis eu pede mollis pretium. Integer " +
    		"tincidunt. Cras dapibus. Vivamus elementum semper nisi. " +
    		"Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor " +
    		"eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, " +
    		"dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra " +
    		"nulla ut metus varius laoreet. Quisque rutrum. Aenean " +
    		"imperdiet. Etiam ultricies nisi vel augue. Curabitur " +
    		"ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. " +
    		"Maecenas tempus, tellus eget condimentum rhoncus, sem " +
    		"quam semper libero, sit amet adipiscing sem neque sed " +
    		"ipsum. Nam quam nunc, blandit vel, luctus pulvinar, " +
    		"hendrerit id, lorem. Maecenas nec odio et ante tincidunt " +
    		"tempus. Donec vitae sapien ut libero venenatis faucibus. " +
    		"Nullam quis ante. Etiam sit amet orci eget eros faucibus " +
    		"tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec " +
    		"sodales sagittis magna. Sed consequat, leo eget bibendum " +
    		"sodales, augue velit cursus nunc."
    										 
    		private var tf:TextField;
    		
    		private var tilted:Sprite;
    		
    		private var step:Number = 1;
    		
    		public function Main():void 
    		{
    			if (stage) init();
    			else addEventListener(Event.ADDED_TO_STAGE, init);
    		}
    		
    		private function init(e:Event = null):void 
    		{
    			removeEventListener(Event.ADDED_TO_STAGE, init);
    			// entry point
    			drawStars();
    			tilted = new Sprite();
    			addChild(tilted);
    			tilted.rotationX = -30;
    			tf = new TextField();
    			tf.width = 300;
    			tf.autoSize = TextFieldAutoSize.LEFT;
    			tf.wordWrap = true;
    			tf.multiline = true;
    			tf.text = textContent;
    			tf.textColor = 0xffff00;
    
    			tilted.x = (stage.stageWidth - tf.textWidth) / 2;
    			tf.y = (stage.stageHeight);
    			tilted.addChild(tf);
    			
    			addEventListener(Event.ENTER_FRAME, scrollText);
    		}
    		
    		private function drawStars():void {
    			var w:int = stage.stageWidth;
    			var h:int = stage.stageHeight;
    			var starField:BitmapData = new BitmapData(w,h, false, 0x000000);
    			for (var i:int = 0; i < 500; i++) {
    				starField.setPixel(Math.floor(Math.random() * w), Math.floor(Math.random() * h), 0xffffff);
    			}
    			addChild(new Bitmap(starField));
    		}
    		
    		private function scrollText(e:Event):void {
    			tf.y -= step;
    			
    			//trace(tf.y);
    			if (tf.y <= -1 * (tf.textHeight)) {
    				tf.y = stage.stageHeight;
    			}
    		}
    		
    	}
    	
    }

  8. #8
    Senior Member
    Join Date
    Apr 2004
    Posts
    132
    I thank you ever so much for your time and assistance.

    However, this doesn't help my scenario really as I need it to function within the flash environment as an animation and NOT as as3 code.

    You see, I want to span my anim across x amount of frames and then play around with different animations above and below etc.

    I cannot learn from scripting as such hence why I was using that tutorial as it creates the effect using tweens and movie clips that i can see / build myself rather than as3 doing the donkey work.

    In addition though, I did but try your code and it didn't seem to function as it threw up an output error.

    I apologise for seeming ungrateful, this is certainly not my intention, I work a certain way, and that way is with visual animation.

  9. #9
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Hopefully, someone else can help you then, since I don't know any of that.

    If you just want to see it work, set your document class to Main. Actually, here. I've attached the a zip with the swf in it.
    Attached Files Attached Files

  10. #10
    Senior Member
    Join Date
    Apr 2004
    Posts
    132
    Thanks - I tried to open that but just a black screen for me I'm afraid.

  11. #11
    Senior Member
    Join Date
    Apr 2004
    Posts
    132
    Anyone, please !?!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center