Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c02/h01/mnt/46561/domains/ on line 520

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c02/h01/mnt/46561/domains/ on line 535

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c02/h01/mnt/46561/domains/ on line 542

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c02/h01/mnt/46561/domains/ on line 578

Deprecated: Function set_magic_quotes_runtime() is deprecated in /nfs/c02/h01/mnt/46561/domains/ on line 18
VideoViewer Class (AS3) | kreativeKING - Interactive Developer

' 08 July, 30 - 5:27 am

VideoViewer Class (AS3)

Post Header

The VideoViewer Class is a class I created to quickly put together a video player in a matter of minutes. This is just part of a package that includes other classes such as the ProgressionBar Class which controls the scrubber and the time line. I will release the other classes at a later date.

The VideoViewer class has an easy to use API , that only consists of a couple methods and properties.



This sets up the video to be played. This method MUST be called for the class to work. Without calling this method, the video wil never get loaded into the viewer.


This toggles the pause and play states of the video. This is needed to start the video after the readyVideo() method is called. It can be place in play button functions or right after the readyVideo() method to start the video automatically.


This closes the video connection and stops the video. Once this is called, to play the video again, You need to recall the readyVideo() method.


This allows you to jump to different points in the video. This method allows one parameter. This parameter is the number (in seconds) you want the play head of the video to jump to.



Returns the NetStream Object inside the VideoViewer.


Sets the what video to play as a String //Ex: VideoViewer.file = “myVIdeo.flv”;
Also returns what video is currently set.


Sets the buffer amount in seconds.


Change the Linkage of a MovieClip to VideoViewer —–
Be sure to make it the base class if you plan to have more than one VideoViewer in your scene.

Helper Events

Along with the methods and properties included with the VideoViewer API. There are also events that keep track of certain data.


This will allow you to keep track of some information dealing with the VideoViewer instance.


This keeps track of the duration of the video being played.

Here is an example of how to easily set up the VideoViewer.

import flash.display.Sprite;
viewer.file = "myVideoflv";

viewer in the above example is a VideoViewer Instance.

Known Bugs:
1) Scaling the VideoViewer will distort the video that it is playing. A workaround is to set the size of the shape inside the Movieclip or to set the height and width of the Video Viewer manually. Ex:

VideoViewer.height = 100;
VideoViewer.width = 100;

This is a very useful class and I hope you put it to good use. If there are any questions at all please post them here and I will try to answer them in a timely manner.


Download VideoViewer Class Here

No related posts.

  • It is really enjoyable reading your post, i have gather sufficient concepts for my upcoming write-up.

  • Well the VideoViewer Class is depricated for the new and improved VideoWindow Class. Yes the VideoWindow Class is very easy to use. If you are looking to setup a Javascript function to trigger an AS3 function. You'll have to setup a ExternalInterface for it to work. You're in Luck though as i created an example on using the ExternalInterface Class not too long ago. Check it out here

  • Daniel

    Im looking to buy it.... but is it hard for me to modify so i can call the play and pause functions from a html link using javascript?

    Im not a programmer, now just a little as1.

    Would be extremly glad if you could answer this before i purchase it.

blog comments powered by Disqus