This is a translated page. The original can be found here: http://www.designscripting.com/2009/02/fader-apislideshow-with-movieclips-on-stage/
Home » ActionScript 3.0 ホーム » 3.0のActionScript

Fader API:Slideshow with MovieClips on stageフェーダーのAPI:スライドショームービークリップをステージ上で

12 February 2009 2009年2月12日 No Comment コメント無し

The aim of this tutorial is to create slideshow using the FaderAPI.このチュートリアルの目的は、スライドショーをFaderAPIを使用して作成することです。
Fader API can be used to create Sequence of fade animations, Slideshows with less code.フェーダーAPIは、アニメーションをフェードのシーケンスを作成するために使用することができます、少ないコードでスライドショー。

Note: 注:
In this tutorial we are going to use Fader API to create slideshow from DisplayObjects present in stage.この我々がDisplayObjects段階で現在からスライドショーを作成するフェーダーAPIを使用する予定ですチュートリアルでは。 Not the dynamic one as we created in previous version.しない動的な我々は以前のバージョンで作成した。
This tutorial is indented for basic – intermediate skill set.このチュートリアルは、基本的なâのインデントさ"の中間のスキルセットをユーロ。 Follow the link to create slideshow dynamically using FaderFileMaterialしてくださいリンクをFaderFileMaterial を使用して作成動的にスライドショーを

Difficulty: 難易度:
Basic – Intermediate.基本 - 中級。
Even the entry level programmers and beginners can use this API easily.もエントリーレベルのプログラマーや初心者が簡単にこのAPIを使用することができます。

Features: 特徴:
Some features are一部の機能があります
Less code少ないコード
Slide to slide transitionスライドトランジションをスライドさせる
No Preloader neededいいえプリローダーが必要
Customized events to handle slideshowカスタマイズイベントは、スライドショーを処理する

Flash Version: Flashのバージョン:
Flash 9 + Actionscript 3.0フラッシュ9 +アクション3.0

Using Fader Class: クラスを使用してフェーダー:

We are going to use Fader Class to create Slideshow/animate DisplayObjects present at stage.我々は段階でスライドショー/アニメーションDisplayObjectsを現在作成するフェーダークラスを使用する予定です。 If you are looking to load image from external URL use FaderFileMaterial.あなたが外部のURLを使用FaderFileMaterialからイメージを読み込むために探している場合。

Import the Classes: インポートクラス:

 import com.utils.Fader.*;輸入com.utils.Fader .*;
import com.utils.Fader.FaderItems;輸入com.utils.Fader.FaderItems;
import com.utils.Fader.Events.*;輸入com.utils.Fader.Events .*; 

Importing the external classes makes the external classes available to use in Code.外部クラスをインポートする外部クラスをコード内で使用できるようになります。

Defining the duration variables: 変数を定義する期間:

 var fadeInDuration:Number = 1;ヴァールfadeInDuration:数= 1;
var fadeOutDuration:Number = 3;ヴァールfadeOutDuration:数= 3; 

Duration variables define the time in seconds with the transition should take place.期間変数の移行数秒で行われなければならない時間を定義します。

Create FaderItems: 作成FaderItems:

 var _faderItems:FaderItems = new FaderItems( fadeInDuration, fadeOutDuration );ヴァール_faderItems:FaderItems =新しいFaderItems(fadeInDuration、fadeOutDuration);
_faderItems.addObject(rect1); _faderItems.addObject(rect1);
_faderItems.addObject(rect2); _faderItems.addObject(rect2);
_faderItems.addObject(rect3); _faderItems.addObject(rect3); 

FaderItems used as stack to store Display Object and TextField, The added items will be taken into account for creating the animation. FaderItemsは、表示オブジェクトをとTextField、追加項目を保存するアカウントにアニメーションを作成するために取られるスタック使用されます。

Just pass the instance name provided in the property window to add into animation.ただアニメーションに追加するインスタンス名をプロパティウィンドウで提供される渡します。

Finally to create Fader: 最後に、フェーダーを作成する:

 var _fader:Fader = new Fader(_faderItems,5000,true);ヴァール_fader:フェーダー=新しいフェーダー(_faderItems、5000、真の);
_fader.addEventListener(ObjectEvent.FADER_INIT, handleInit); _fader.addEventListener(ObjectEvent.FADER_INIT、handleInit);
_fader.addEventListener(ObjectEvent.FADER_ITEM_INIT, handleItemInit); _fader.addEventListener(ObjectEvent.FADER_ITEM_INIT、handleItemInit);
_fader.addEventListener(ObjectEvent.FADER_ITEM_COMPLETE, handleItemComplete); _fader.addEventListener(ObjectEvent.FADER_ITEM_COMPLETE、handleItemComplete);
_fader.addEventListener(ObjectEvent.FADER_COMPLETE, handleComplete); _fader.addEventListener(ObjectEvent.FADER_COMPLETE、handleComplete);
_fader.start(); _fader.start(); 

Here we are just passing the FaderItems Object that we created in above step.ここで私達はちょうどFaderItemsオブジェクトを、我々は上記の手順で作成した通過している。

Second argument is the delay duration. 2番目の引数は、遅延期間です。

Third argument is Boolean which specifies whether the animation should repeat after EOF. 3番目の引数はブールするかどうかのアニメーションは、EOFの後から繰り返すように指定されます。

Fades DisplayObjects on given delay.フェードDisplayObjects指定された遅延します。 Using the Fader Class it is easy to create Slideshow or of Fade animationフェーダークラスを使用してそれがスライドショーやフェードのを簡単に作成、アニメーションは、

Online Documents for Classes used クラスを使用するためのオンラインドキュメント

Fader: http://www.designscripting.com/wp-content/uploads/2009/01/fader.htmlフェーダー: http://www.designscripting.com/wp-content/uploads/2009/01/fader.html
Faderitems: http://www.designscripting.com/wp-content/uploads/2009/01/faderitems.html Faderitems: http://www.designscripting.com/wp-content/uploads/2009/01/faderitems.html

Entire Example: 全体の例:

 import com.utils.Fader.*;輸入com.utils.Fader .*;
import com.utils.Fader.FaderItems;輸入com.utils.Fader.FaderItems;
import com.utils.Fader.Events.*;輸入com.utils.Fader.Events .*;

var fadeInDuration:Number = 1;ヴァールfadeInDuration:数= 1;
var fadeOutDuration:Number = 3;ヴァールfadeOutDuration:数= 3;

var _faderItems:FaderItems = new FaderItems( fadeInDuration, fadeOutDuration );ヴァール_faderItems:FaderItems =新しいFaderItems(fadeInDuration、fadeOutDuration);
_faderItems.addObject(rect1); _faderItems.addObject(rect1);
_faderItems.addObject(rect2); _faderItems.addObject(rect2);

var _fader:Fader = new Fader(_faderItems,5000, true);ヴァール_fader:フェーダー=新しいフェーダー(_faderItems、5000、真の);
_fader.addEventListener(ObjectEvent.FADER_INIT, handleInit); _fader.addEventListener(ObjectEvent.FADER_INIT、handleInit);
_fader.addEventListener(ObjectEvent.FADER_ITEM_INIT, handleItemInit); _fader.addEventListener(ObjectEvent.FADER_ITEM_INIT、handleItemInit);
_fader.addEventListener(ObjectEvent.FADER_ITEM_COMPLETE, handleItemComplete); _fader.addEventListener(ObjectEvent.FADER_ITEM_COMPLETE、handleItemComplete);
_fader.addEventListener(ObjectEvent.FADER_COMPLETE, handleComplete); _fader.addEventListener(ObjectEvent.FADER_COMPLETE、handleComplete);
_fader.start(); _fader.start();

function handleInit(e:ObjectEvent):void関数handleInit(電子:でObjectEvent):無効
{
 trace("::::::::::Fader Started:::::::::") :::::::::")スタート("::::::::::フェーダーをトレース
}
function handleItemInit(e:ObjectEvent):void関数handleItemInit(電子:でObjectEvent):無効
{
 trace("init:: "+e.targetObject.name) ("initのトレース::"+ e.targetObject.name)
}
function handleItemComplete(e:ObjectEvent):void機能handleItemComplete(電子:でObjectEvent):無効
{
 trace("complete:: "+e.targetObject.name) ("完全なトレース::"+ e.targetObject.name)
}
function handleComplete(e:ObjectEvent):void機能handleComplete(電子:でObjectEvent):無効
{
 trace(":::::::::Fader Complete:::::::::") (":::::::::フェーダー完全:::::::::")トレース
}

stop_mc.addEventListener(MouseEvent.CLICK, handleStop) stop_mc.addEventListener(MouseEvent.CLICK、handleStop)
function handleStop(e:MouseEvent):void{関数handleStopは(電子:MouseEventの):(無効
 _fader.stop(); _fader.stop();
}
play_mc.addEventListener(MouseEvent.CLICK, handlePlay) play_mc.addEventListener(MouseEvent.CLICK、handlePlay)
function handlePlay(e:MouseEvent):void{関数handlePlayは(電子:MouseEventの):(無効
 _fader.start(); _fader.start();
} 

For more detailed description use the Documentation. 説明については、より詳細なドキュメントを使用します。

Fader Class http://www.designscripting.com/wp-content/uploads/2009/01/fader.htmlフェーダークラスhttp://www.designscripting.com/wp-content/uploads/2009/01/fader.html
Faderitems Class http://www.designscripting.com/wp-content/uploads/2009/01/faderitems.html Faderitemsクラスhttp://www.designscripting.com/wp-content/uploads/2009/01/faderitems.html
FaderURL Class http://www.designscripting.com/wp-content/uploads/2009/01/faderurl.html FaderURLクラスhttp://www.designscripting.com/wp-content/uploads/2009/01/faderurl.html
FaderFileMaterial http://www.designscripting.com/wp-content/uploads/2009/01/faderfilematerial.html FaderFileMaterial http://www.designscripting.com/wp-content/uploads/2009/01/faderfilematerial.html

Find the example source for creating SlideShow using Fader with the source file.フェーダーのソースファイルを使用してスライドショーを作成するためのサンプルソースを検索します。

VN:F [1.7.7_1013]ベトナム:はF [1.7.7_1013]
Rating: 0.0/ 10 (0 votes cast)評価:0.0 / 10(投票数0投票)
VN:F [1.7.7_1013]ベトナム:はF [1.7.7_1013]
Rating: 0 (from 0 votes)評価:0(投票数0から)
Translate this post翻訳この記事




Leave your response!あなたの応答を残す!

Add your comment below, or trackback from your own site.下記のコメント、またはトラックバックのサイトから自分の。 You can also subscribe to these comments via RSS.また、することができますコメントこれらの購読する RSS経由で。

Be nice.いいしてください。 Keep it clean.それをきれいにしてください。 Stay on topic.トピックに滞在。 No spam.いいえスパム。

You can use these tags:あなたはこれらのタグを使用できます:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog.これはGravatar、ウェブログが有効。 To get your own globally-recognized-avatar, please register at Gravatar .で、認識を得る独自の世界的にアバター登録してください、 グラバター

CAPTCHA Image
印象を新たにする