In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

スターウォーズ風にフードを紹介

文章はうぃきぺから
* http://en.wikipedia.org/wiki/Adobe_Flash
Get Adobe Flash player
by hacker_tm96tqv8 18 Nov 2009
// forked from hacker_tm96tqv8's forked from: 文章をスターウォーズ風に
// forked from rsakane's 文章をスターウォーズ風に
/*
 * 文章はうぃきぺから
 * http://en.wikipedia.org/wiki/Adobe_Flash
 */
package
{
    import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.engine.*;
    
	[SWF(width = "465", height = "465", frameRate = "30", backgroundColor = "0x0")]
    public class Main extends Sprite
	{
		private var lines:Vector.<TextLine> = new Vector.<TextLine>();
		private var frame:int = 0;
		private var prev:TextLine = null;
		private var textBlock:TextBlock;
		
        public function Main():void 
		{   
            var str:String =
			"バイネイチャーシリーズは\n\nスーパープレミアムフード\n\n【ホリステック総合栄養食】\n\nNo Corn ,\n\nNo Wheat ,\n\n No Soy ,\n\n安全安心な原材料\n\n良質なタンパク源\n\n強力なビタミン\n\nミネラル、数種のハーブ\n\n野菜、フルーツ\n\n抗酸化栄養素\n\nプロバイオティクスなどで\n\n強い免疫システムを!!\n\n天然ビタミンCとEを使い、\n\nナチュラルに新鮮さを\n\n病気や環境ストレスから解放\n\n愛犬の健康をサポート\n\n" +
			"by nature Pork\n\nby nature Salmon\n\nby nature Duck\n\n犬幼稚園 Buddy Dog\n\n園長が推奨する\n\n"
			var format:ElementFormat = new ElementFormat(null, 25, 0xad9429);
            var textElement:TextElement = new TextElement(str + str + str, format); 
            textBlock = new TextBlock();
            textBlock.content = textElement; 
			
			addEventListener(Event.ENTER_FRAME, onEnterFrame);
        }
		
		private function onEnterFrame(event:Event):void
		{
			if (frame++ % 30 == 0)
			{
                var textLine:TextLine = textBlock.createTextLine(prev, 400);
                if (textLine != null)
				{	
					textLine.y = 500;
					textLine.x = 232 - textLine.width / 2;
					textLine.rotationX = -45;
					addChild(textLine);                
					prev = textLine;
					lines.push(textLine);
				}
			}
			
			for (var i:int = 0; i < lines.length; i++)
			{
				if (lines[i].y <= 100) lines[i].alpha -= 0.01;
				lines[i].y--;
				lines[i].z++;
				
				if (lines[i].alpha <= 0.1)
				{
					removeChild(lines[i]);
					lines[i] = null;
					lines.splice(i--, 1);
				}
			}
		}
    }
}