Subscribe

  • Subscribe  

How to add isPlaying Property to Movie Clips with AS3

Posted by Jay | May 5, 2008 .

Web designer are always looking for means to makes their sites eye catchy and thereby videos and movie clips etc are often placed to jazz things up. To make them look millions buck, ActionScript3 gives the leverage to play around .Be it videos or sound files or movie clips, flash files, we need mechanism to initialize, start and stop them and to program them as per need. For all this and many more customizations Action script3 has built in API’s (methods) to work around.

As Add on to check if movie clip or a video file is over or still running, ActionScript 3 “movieclip” class has the method “isPlaying”. It is the available as API method under the “movieclip” class which extends from class “display “.”display” class comes under “flash” class as shown below.

Package {   import flash.display.MovieClip;

public class Movie1 extends MovieClip {

public function get isPlaying():Boolean {//}

}

The prototype for “isPlaying” property is written as

Public function isPlaying ( ): Boolean; is prototype available in AS3 library as shown in above code snippet. “movieclip” class can be extended and can be overridden to add and provide new functionality.

In order to use it  Create and object of “movie1” class

Var movie1: MovieClip = new MovieClip();if(movie1.isPlaying)

{

    myMovie.stop();

}

Leave a Comment

If you would like to make a comment, please fill out the form below.


Name

Email

Website

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Comments

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word


Related Posts

2 Comments so far
  1. Davide  May 6, 2008 10:00 am

    Molto interessante, a riguardo mi piacerebbe avere un esempio con una movie clip creata in flash e caricata con swfLoader (in flex) e la clip cui faccio riferimento si chiama “mymovie”.
    Mi chiedevo se posso anche fare riferimento ad un fotogramma specifico (in actionscript 2 uscavo il _currentframe…
    Vi ringrazio in anticipo.

  2. Wenderson Pires  September 29, 2011 10:46 pm

    This is possible. Hello, I am teaching this in my blog, I discovered with a question myself, I tried and it worked. It is very useful to see, look http://www.wpdas.com.br/blog/?p=713 This in AS3.

<

Direct TV Offers - usdirect has the best directtv deals