Marquee using flash
Yes i know, there are plenty of marquees using Javascript, but how would it look made in flash. Let's try.
Actualy everything looks very simple just one document neede for AS3. It's main flash document.
AS3 code:
package
{
import flash.display.*;
import flash.events.*;
import flash.text.*;
import gs.TweenLite;
import gs.easing.*;
public class ScrollLine extends MovieClip
{
public function ScrollLine()
{
//var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
text_content.text = "Warinng i'm running marque :) Warinng i'm running marque :) Warinng i'm running marque :) Warinng i'm running marque :) Warinng i'm running marque :) Warinng i'm running marque :)";
var formatText:TextFormat = new TextFormat("Verdana",12,0xFF3198,true);
text_content.setTextFormat(formatText);
text_content.multiline = false;
text_content.wordWrap = false;
text_content.autoSize = "left";
text_content.x = 982;
this.startAnimation();
}
public function startAnimation():void
{
TweenLite.to(text_content, 43, {x:-text_content.width,ease:Linear.easeNone,onComplete: completeAnimation});
}
public function completeAnimation():void
{
text_content.x = 982;
this.startAnimation();
}
}
}
Working example can be found here.
Downloads source code
Back »
Comments: 0
Leave a reply »