Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE FLASH: HomeFlash ForumFlash TutorialsFlash Video TutorialsWeb Streaming ForumAdobe FlashPodcast

Animation Loop Code

Cow Forums : Adobe Flash
VIEW POSTS   •   ADD A NEW POST   •   SEARCH   •   CHANGE FORUM
Respond to this post   •   Return to posts index   •   Read entire thread


Animation Loop Code
by Cutter Johnston on Jun 11, 2009 at 11:18:32 am

A while back I was asking how to continuously loop an animation . I did not receive any truly useful relpies. I did come up with a solution that is flexible, expandable and works great. Here is the code:

import fl.video.*;

stop();

var arrayNum:Number = 0;

var videoArray:Array = new Array();
videoArray[0] = "AnimationOfFlyingZits.flv";

var flvControl = playBack;
var flvSource = videoArray[arrayNum];


playBack.pauseButton = pauseBtn;
playBack.playButton = playBtn;
playBack.source = videoArray[arrayNum];

playBack.addEventListener(VideoEvent.COMPLETE, videoComplete);

playBack.source = videoArray[arrayNum];


function videoComplete(event:VideoEvent):void{
//trace(event.target.source);
if(event.target.source == videoArray[0]){
event.target.play();

}

}

The solution is in the EventListener for the playBack and the function below it.

Hope it helps someone with the same issue!

Cutter



Respond to this post   •   Return to posts index   •   Read entire thread


Current Message Thread:




Note: If you are a registered user please click here to login before posting.

Your post will not be accepted if your name and email address are not registered in our database. Click here if you do not have an account.

Name
E-Mail Address
Subject
E-Mail me when someone responds
Just This Message   Entire Thread   None  

Message:



Note: The following are HTML characters and may cause parts of your post to disappear if not used correctly: < > &
To include any portion of the post in your response, highlight the desired text and hit the "Q" key. Read more...



Add your message signature


 


Note: By clicking "Post Direct" button above, you are agreeing to the Creative Cow's Code of Conduct.



FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]