flash on 2011-8-20
Meta data needs to go before the class declaration
465*465 is the wonderfl display size
♥0 |
Line 38 |
Modified 2011-08-20 19:50:14 |
MIT License
archived:2017-03-20 08:52:04
ActionScript3 source code
/**
* Copyright sinclairc5 ( http://wonderfl.net/user/sinclairc5 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/pRdb
*/
package
{
import flash.display.Sprite;
import flash.text.*;
import flash.geom.Point;
import gs.TweenLite;
/**
*
* Meta data needs to go before the class declaration
*
* 465*465 is the wonderfl display size
*
*/
[SWF(width="465",
height="465",
backgroundColor="0x000000",
frameRate="40")]
public class FlashTest extends Sprite
{
private var _txt:TextField;
private var _txtFormat:TextFormat;
public function FlashTest()
{
//var v:Vector.<Point> = new Vector.<Point>();
_txtFormat = new TextFormat();
_txtFormat.color = 0xffffff;
_txtFormat.size = 30;
_txtFormat.font = "Arial";
_txt = new TextField();
_txt.x = 100;
_txt.defaultTextFormat = _txtFormat;
_txt.autoSize = TextFieldAutoSize.LEFT; //allows the text field to autosize its width
_txt.htmlText = "<I><B>Paul Stamp</B></I>";
addChild( _txt );
moveDown();
}
private function moveDown():void
{
TweenLite.to( _txt, 3, { y:100, onComplete:moveUp } );
}
private function moveUp():void
{
TweenLite.to( _txt, 3, { y:0, onComplete:moveDown } );
}
}
}