XML Driven Video Gallery with Playlist
Hi,
I have put together a XML Driven Video Player with auto thumbnail detection but there is a problem.The Video plays but, The thumbs will not show. I think my thumbnail function is not reaching the correct node in my XML.Can someone take a look at my Actionscript Please? The Action Script is below. The XML is at the bottom of this post. The top half of the code is the video playing code the bottom is for the thumbs.
Actionscript 2.0
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setNufferTime(30);
ns.onStatus = function(info) {
if (info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
if (info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
if (info.code == "NetStream.Buffer.Stop") {
ns.seek(0);
theVideo.attachVideo(ns);
rewindButton.onRelease = function() {
ns.seek(0);
playButton.onRelease = function() {
ns.pause();
var videoInterval = setInterval(videoStatus, 100);
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function (obj) {
duration = obj.duration;
function videoStatus() {
amountLoaded = ns.bytesLoaded/ns.bytesTotal;
loader.loadbar._width = amountLoaded*187.4;
loader.scrub._x = ns.time/duration*187.4;
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit, 10);
this.startDrag(false,0,this._y,187.4,this._y);
loader.scrub.onRelease = loader.scrub.onReleaseOutside=function () {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus, 100);
this.stopDrag();
function scrubit() {
ns.seek(Math.floor((loader.scrub._x/187)*duration));
var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu;
var i1:ContextMenuItem = new ContextMenuItem(":::::Video Controls:::::", trace);
theMenu.customItems[0] = i1;
var i2:ContextMenuItem = new ContextMenuItem("Play / Pause Video", pauseIt, true);
theMenu.customItems[1] = i2;
var i3:ContextMenuItem = new ContextMenuItem("Replay Video", replayIt);
theMenu.customItems[2] = i3;
var i4:ContextMenuItem = new ContextMenuItem("All Rights Reserved 2009", trace, true);
theMenu.customItems[3] = i4;
var i5:ContextMenuItem = new ContextMenuItem("SamAndOnline.com Video Player", trace);
theMenu.customItems[4] = i5;
function pauseIt() {
ns.pause();
function replayIt() {
ns.seek(0);
//sound controls
_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
vSound.attachAudio(ns);
var so:Sound = new Sound(vSound);
so.setVolume(100);
volControl.volcon.slider1.onPress = function() {
this.startDrag(true,volControl.volcon.groove1._x,volControl.volcon.groove1._y,volControl.v olcon.groove1._x,volControl.volcon.groove1._y+100);
slideit = setInterval(volControl.volcon.slider_1Move, 100, this);
volControl.volcon.slider1.onRelease = function() {
this.stopDrag();
clearInterval(slideit);
mute.gotoAndStop("on");
volControl.volcon.slider1.onReleaseOutside = function() {
this.stopDrag();
clearInterval(slideit);
mute.gotoAndStop("on");
mute.onRollOver = function() {
if (so.getVolume() == 100) {
this.gotoAndStop("onOver");
} else {
this.gotoAndStop("muteOver");
mute.onRollOut = function() {
if (so.getVolume() == 100) {
this.gotoAndStop("on");
} else {
this.gotoAndStop("mute");
mute.onRelease = function() {
if (so.getVolume() == 100) {
so.setVolume(0);
this.gotoAndStop("muteOver");
} else {
so.setVolume(100);
this.gotoAndStop("onOver");
//listBx
var vlist:XML = new XML();
vlist.ignoreWhite = true;
vlist.onLoad = function() {
var videos:Array = this.firstChild.childNodes;
for (i=0; i<videos.length; i++) {
videoList.addItem({label:videos[i].attributes.desc,data:videos[i].attributes.url ,image:videos[i].attributes.thumb});
//play 1st video
ns.play(videoList.getItemAt(0).data);
videoList.selectedIndex = 0;
//would like to reference something in the XML File with the thumb attribute
thumbnails_fn(i);
var vidList:Object = new Object();
vidList.change = function() {
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
videoList.addEventListener("change",vidList);
vlist.load("videos.xml");
soundb.onRelease = function() {
if (volControl.switch2=open2) {
volControl.gotoAndPlay("open");
} else {
volControl.play();
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
} else {
delete tscroller.onEnterFrame;
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
target_mc.onRollOut = function() {
this._alpha = 100;
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(image[k], "thumbnail_mc.t"+k);
trace(videoList.getItemAt(0).image+ "k= "+k+" "+videos.length+" pv "+target_mc.pictureValue+" thumbnails");
XML Example
<?xml version="1.0" encoding="ISO-8859-1"?>
<videos>
<video url="vid1.flv" desc="Video 1" thumb="1.jpg"/>
<video url="vid2.flv" desc="Video 2" thumb="2.jpg"/>
</videos>
I'm trying to load the thumbnails in with this code
image_mcl.loadClip(image[k], "thumbnail_mc.t"+k);
i tried
videoList.getItemAt(k).image
which works in the trace method but gives no response in the actual code it self
So the line of code that should work is
image_mcl.loadClip(videoList.getItemAt(k).image, "thumbnail_mc.t"+k);
and not
image_mcl.loadClip(image[k], "thumbnail_mc.t"+k);
but I gets no response
Similar Messages
-
XML driven FLV player with playlist, can someone please help me?
OK so ive been working for a client recently building him a new site for his racing team and he wants a video jukebox on the "videos section" of the site.
Now i am the one with the job of updating this jukebox with new videos which he makes (this happens often) so i want updating to be as easy as possible.
Im new to the use of XML with flash and followed a tutorial to create a dynamic Image Gallery which is really easy to update, all i have to do is drop the files into the right directories in my FTP client and edit the XML file, perfect.
I want the jukebox to do the same thing.
I want to have a jukebox with a "video screen" with basic controlls (play/pause, volume, rewind, seek) on the left and a small vertically scrolling menu on the right that contains thumbnails and descriptions of the videos that when clicked changes the content of the video component to play the chosen video.
I found a tutorial on the adobe site that shows how to achive this through the use of the "video component" and the "list component" in flash 8 HOWEVER, this isnt very pretty and almost impossible to customise due to the list component and i would like to be able to mimic the style of the image gallery i already produced to keep things all nice and uniform.
i want to use XML to point flash to the source of the FLV files, the source of the thumbnail jpgs and give the text for the description so that its easy to update and use flash's drawing interface to make it pretty.
Basically i want to reproduce something like this.
Ive been searching for weeks now and i cant find anything to help me with this, if anyone knows of any tutorials, books, videos or has any idea how to help me it would be MUCH appreciated.
Thankyou.Try this link:
http://www.taiwantrade.com.tw/MAIN/en_front/searchserv.do?method=listProductComp anyDetail&company_id=163054&locale=2
There is an email address and telephone numbers.
Also look on the box and instructions.
Ciao. -
Video gallery with playlist.
i need a tutorial of video player which must be like youtube video player. please help in this i would be very thankful. it is important and urgent.
preview of a site like this i want it to be.
http://www.tbn.org/video_portal/?which=ptlhttp://active.tutsplus.com/tutorials/actionscript/build-a-dynamic-video-player-with-action script-3-part-1-of-3/
http://www.jacobmake.com/2008/12/as3-video-player/
http://www.darshanrane.com -
Making a apple video gallery with QT?
How do I make a video gallery like this...
http://www.apple.com/findouthow/web/#ftp
Been searching but all I come up with is how to do it with flash. Thanks!Marc ~ The following suggestions are Flash-like video players, but anyway...
I don't know if this one will simply work in iWeb's HTML Snippet Window:
http://www.techcrunch.com/2009/03/01/embedr-lets-you-create-and-share-good-looki ng-video-playlists/
Vimeo recently re-designed their player:
Vimeo cuts the clutter with a sexy redesign
Or there's the YouTube approach:
http://www.techcrunch.com/2007/07/20/youtube-launches-custom-player-feature/
And this: An expert's guide to YouTube -
Spry XML Dataset Video Gallery Question
Hi there,
We are trying to create a video gallery using a Spry XML Dataset.
It's currently working in FF and Safari, but not working in IE6-7 or Opera.
Here is a link... http://www.rightsidedesign.com.au/test/tv.html
IE seems to display the content for a second, but it doesn't load the videos or text, but then it disappears.
The elements being fed via the dataset are the video, video description (at bottom right of video) and thumbnails
Can anyone give us a hint as to what we might be doing wrong??
We followed the tutorial at... http://www.coremediadesign.co.uk/web_design_tutorials/dreamweaver_tutorials/spry_image_gal lery_adobe.html
and replaced the image with an FLV player.
Thanks for your help in advance!Hi there,
We are trying to create a video gallery using a Spry XML Dataset.
It's currently working in FF and Safari, but not working in IE6-7 or Opera.
Here is a link... http://www.rightsidedesign.com.au/test/tv.html
IE seems to display the content for a second, but it doesn't load the videos or text, but then it disappears.
The elements being fed via the dataset are the video, video description (at bottom right of video) and thumbnails
Can anyone give us a hint as to what we might be doing wrong??
We followed the tutorial at... http://www.coremediadesign.co.uk/web_design_tutorials/dreamweaver_tutorials/spry_image_gal lery_adobe.html
and replaced the image with an FLV player.
Thanks for your help in advance! -
XML Driven Photo Gallery (Action Script Help)
Hi,
I need to make a XML Driven Photo slide in Flash CS5.
It needs to have a Box that contains 5 Thumbnails(by XML) act as buttons.
The Box sits on top of the Main photo area and shrinks (or close out) when user click its close button. And it opens out by clicking on a open button.
I'm sure it can be done by using timeline, Tweening or you name it..But what about the Thumbnails that run from the XML file?
Can they disappear with the Box and retrieve when it opens? is it possible?
If yes, what would be the best way to do that?
Any comment would be greatly appreciated!
Here is the ActionScript.
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
import fl.controls.Button;
import flash.display.Shape;
import flash.events.MouseEvent;
import flash.display.MovieClip;
import flash.display.Loader;
import flash.text.TextField;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.display.Shader;
var hasloaded:Boolean = false;
var firstLoaded:Boolean = false;
var barWidth:int;
var barHeight:int;
var images;
var imageCount:int;
var thumbnailArray:Array = new Array();
var bigImageArray:Array = new Array();
var descriptionArray:Array = new Array();
var xmlLoader:URLLoader = new URLLoader();
var imageXML:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("slideshow.xml"));
function LoadXML(e:Event):void {
imageXML = new XML(e.target.data);
ParseImages(imageXML);
Populates the arrays with the image values
and the text for each picture.
function ParseImages(imageInput:XML):void {
var iconList:XMLList = imageInput.image.icon;
var mainImageList:XMLList = imageInput.image.mainimage;
var descriptionList:XMLList = imageInput.image.description;
for (var i:int = 0; i < iconList.length(); i++) {
var imageElement:XML = iconList[i];
//trace(imageElement);
thumbnailArray[i] = imageElement;
for (var j:int = 0; j < mainImageList.length(); j++) {
var mainimageElement:XML = mainImageList[j];
//trace(mainimageElement);
bigImageArray[j] = mainimageElement;
for (var l:int = 0; l < descriptionList.length(); l++) {
var descriptionElement:XML = descriptionList[l];
//trace(descriptionElement);
descriptionArray[l] = descriptionElement;
loadImages();
function loadImages():void{
trace("inside of loadimages function.");
trace(thumbnailArray.length);
for(var i:int=0; i < thumbnailArray.length; i++){
trace(thumbnailArray[i]);
populateContainers(thumbnailArray[i], i);
//populateContainers2();
trace("Loaded " + thumbnailArray[i]);
var loader:Loader;
var xStart = -210;
var ypos = -34;
var currentPos = xStart;
var incrementValue = 66;
This takes in the name of the image file and
displays it within the newly created movie clip
function populateContainers(file:String, pos:int):void{
//create a movie clip to hold the image
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0xFFFFFF);
mc.graphics.drawRect(0, 0, 50, 51);
mc.graphics.endFill();
mc.buttonMode = true;
mc.x = currentPos;
mc.y = ypos;
mc.name = "thumb_" + pos;
mc.addEventListener(MouseEvent.CLICK, clickHandler);
loader = new Loader();
//loader.mask = imagemask;
var url:URLRequest = new URLRequest(file);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadInitialImage);
loader.load(url);
//add the image to the movie clip
mc.addChild(loader);
this.imageBar.addChild(mc);
//increment the currentPos
currentPos += incrementValue;
function clickHandler(e:MouseEvent):void{
var str:String = e.currentTarget.name;
var index:int = int(str.substr(6,1));
if(hasloaded) {
this.mainWindow.removeChild(loader);
loader = new Loader();
loader.load(new URLRequest(bigImageArray[index]));
this.mainWindow.addChild(loader);
TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeOut});
//setChildIndex(loader, 0);
hasloaded = true;
loadText(index);
function loadText(index:int):void {
Object(this).imageBar.txtdescription.text = descriptionArray[index];
function loadInitialImage(event:Event):void {
if(!firstLoaded) {
loader = new Loader();
loader.load(new URLRequest(bigImageArray[0]));
this.mainWindow.addChild(loader);
TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeIn});
//setChildIndex(loader, 0);
hasloaded = true;
loadText(0);
firstLoaded = true;
/* This section defines the buttons that control the image bar */
Object(this).imageBar.btnBarOpen.addEventListener(MouseEvent.MOUSE_UP, openImageBar);
function openImageBar(event:MouseEvent):void {
this.gotoAndPlay(1);Well Thats what i know but you might be able to use flash player 10 in your browser i think the file system works on it fine im not sure i mostly work on air glad i could help
James -
Creating video gallery with thumbnails?
Hi everyone. I'm trying to create this video gallery that has clickable thumbnails on it. When no one is around to click on the thumbnails, the videos play on a loop. However, I want there to be the ability to see thumbnails while the videos are playing so that if someone comes along, they can click on that thumbnail and view that specific video.
I've been trying out different themes in iDVD, but nothing seems to have that feature where you can still see the thumbnails of the different videos you have while a video is playing. Anyone know of how to do this? Help would be greatly appreciated!!Theoretically yes but I haven't tried it. You could try to create a disk image and play it with Mac Blu-Ray Player. But as I said I have no first hand knowledge regarding this.
Note that your video needs to HD to go the Blu-Ray route. Otherwise it makes no sense. -
Help - xml driven photo gallery
Hello,
I have a very simple ajax page. There is a dropdown from
which the user selects the gallery and then there is an xml file
that send back the xml full of pictures for that gallery. The
problem is that on changing the gallery in the dropdown, sometimes
it works and then it doesnt. More like it works the first time (so
new pictures load up fine) and then it doesnt. I cant figure out
for the life of me why this wont work right. I have tried looking
at the xml, it is running fine, takes a url parameter as the
galleryid and generates the xml. The alert in the get_pictures
alwys pops up but the loadData seems like not working. Been looking
over this code for hours now. Here is the relevant code:
<script type="text/javascript">
var dsPhotos = new
Spry.Data.XMLDataSet("test_getpics_xml.cfm?galleryid=<cfoutput>#galleryid#</cfoutput>",
"photos/photo");
//var dsPhotos = new
Spry.Data.XMLDataSet("test_getpics_xml.xml?galleryid=<cfoutput>#galleryid#</cfoutput>",
"photos/photo");
//var dsPhotos_page = new
Spry.Data.PagedView(dsPhotos,{pageSize: 20});
//var dsPhotos_page_info = dsPhotos_page.getPagingInfo();
function get_pictures(galleryid)
urltext='test_getpics_xml.xml?galleryid='+galleryid
alert(urltext)
dsPhotos.setURL(urltext)
dsPhotos.loadData()
</script>
<table>
<tr>
<td>Galleries:
<select name="galleryid"
onChange="get_pictures(this.value)">
<cfoutput query="qry_galleries">
<option
value="#galleryid#">#galleryname#</option>
</cfoutput>
</select>
</td>
</tr>
</table>
<div spry:region="dsPhotos">
<div spry:repeat="dsPhotos"> <a href="##"
onclick="alert('hey')"><img width="100" height="100"
src="{@picture}" /></a>
<p><br />
</p>
</div>
</div>
I have Firebug plugin installed on my Firebox and there is no
error on it. Any help will be appreciated. Thanks a lot.Hi vansh110,
It's really hard to diagnose the problem without actually
seeing your example in action. If you can't give us an URL to look
at, then the best we can do is suggest some debugging tips.
Try adding an observer to your data set that prints the
notifications:
dsPhotos.addObserver(function(notificationType, notifier,
data)
Spry.Debug.trace(notificationType);
if (notificationType == "onPostLoad")
Spry.Debug.trace("<pre>" +
Spry.Utils.encodeEntities(dsPhotos.getData().toSource()) +
"</pre>");
That way you can watch what states the data set is going
through. The trace statement will only work in FireFox due to the
use of toSource(), but it will show you what the final data set
looks like after the data is loaded and flattened into a table.
Next, you can turn on region debugging:
Spry.Data.Region.debug = true;
That should show you the markup that is being generated after
data is loaded.
--== Kin ==-- -
Looking for an xml driven video/photo player for portfolio website
I need to make a website that displays videos and photos.
Here's an example:
http://www.mazmakhani.com/
Does anyone know of a .fla template that fits the bill?
ThanksHi
You'll find a couple
Here, that will give you a
base to start from
Hope it helps -
Creating a very simple XML-driven gallery
Hi, I'm learning XML in AS3 and I am having real trouble finding a resource that can help me learn how to build a very simple XML-driven picture gallery.
I am working in an FLA file with AS3, with a dynamic text field with the instance name "textfield". I also have a UILoader Component with the instance name "UILoaderComponent" and an XML file called "rootdir.xml".
I have an XML file in the following format.
<images>
<imagenames>
<name>image1</name>
<name>image2</name>
<name>image3</name>
<name>image4</name>
<name>image5</name>
</imagenames>
<imagepaths>
<path>image1.jpg</path>
<path>image2.jpg</path>
<path>image3.jpg</path>
<path>image4.jpg</path>
<path>image5.jpg</path>
</imagepaths>
</images>
I am using the following as my actionscript.
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("rootdir.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
parseImg(xmlData);
function parseImg(imgLoad:XML):void {
var imgChild:XMLList = imgLoad.images.children();
for each (var imgTrace:XML in imgChild) {
trace(imgTrace);
No matter which way I experiment, I always have poor results with my dynamic text, and every tutorial I've followed does not reproduce anything like the same returned data in "textfield" that it does with the trace command.
My objective is: I simply want to build a menu inside a textbox called "textfield" that lists images1-5, and when clicked, calls upon the relevant image. For instance: I load the file "rootdir.xml" into the file "index.fla". I call a function to parse the XML into a dynamic text box called "textfield". When image 2 is clicked on the textbox "textfield", it would call upon a function that would load into the UIComponent Loader "image2.jpg".
Are there any tutorials for this? I'm so confused as to why dynamic text operates so differently from the trace command. I'm not interested in doing a fancy menu bar with thumbnails, scrollbars and animations, I just want to learn the basics.I don't really see how you are getting a valid trace out of that code (I get nothing if I try it as is), but as far as the textfield goes, you haven't shown any attempt in your code that might help to point to why you cannot get the text into a textfield. It might be a problem with how you are trying to write to the textfield and not how your are manipulating the data.
While you could make use of a textfield for the menu, doing so is not straightforward, as you would need to implement htmlText with special coding in order to have the text clickable. You might consider using a List component or ComboBox instead.
What I always do when I am working with xml is to store the data into a data structure, usually an array conatining objects, and then make use of that structure rather than dippng into the xml data itself when I utilize the data.
Another thing, which rquigley demonstrated, is that your xml will serve its purpose better if the data for each image is collected under the same node. If you have separate sections for each piece of data like you have, when it comes to editing it will be more prone to error as you have to be sure you are editing the correct entry of each separate group.
I too am no expert in the world of xml, but I have not yet worked with parameters inside the tags, so I would usually structure it as...
<images>
<image>
<imgName>image 1</imgName>
<imgPath>image1.jpg</imgPath>
</image>
<image>
<imgName>image 2</imgName>
<imgPath>image2.jpg</imgPath>
</image>
</images>
Now, back to what you have... let's say you have a textField named imgText that you want to list the image names in. The following should work, though I do not go my usual route of storing the data into an object array first...
function parseImg(imgLoad:XML):void {
var imgNames:XMLList = imgLoad.imagenames.name;
var imgPaths:XMLList = imgLoad.imagepaths.path;
// show name
for each (var nameTrace:XML in imgNames) {
trace(nameTrace);
imgText.appendText(nameTrace +"\n");
// show path
for each (var pathTrace:XML in imgPaths) {
trace(pathTrace);
imgText.appendText(pathTrace +"\n");
// show name and path
for(var i:uint=0; i<imgNames.length(); i++){
trace(imgNames[i].text()+" "+imgPaths[i].text());
imgText.appendText(imgNames[i].text()+" "+imgPaths[i].text() +"\n"); -
Flash Lite XML Driven Gallery Simple Question
Hello Flash Lite Gurus',
Someone Named "Mr. Samir K. Dash;" did a wonderful tutorial regarding Flash Lite XML driven Photo Gallery, and I have just a small question:
1> I changed the attributes schema of the xml as attached and noticed that it is not working, and I wonder what could be the reason (please see the attached XML new attribute schema, I didn't change fields names, I just changed the way the attributes' schema looks like).
The link to the tutorial is the following:
http://www.adobe.com/devnet/devices/articles/xml_photo_gallery.html
Looking forward to your help
best regards
TalalAs I look at your modified XML file, you need to make major changes in the script.
You have changed the attributes to become child nodes. So, you will need to use firstChild.nodeValue or childNodes[i].nodeValue everywhere.
Regards,
Hemanth Sharma
http://www.flashlitehub.com/blog -
Create FLV Video Gallery In Dreamweaver?
Hi and thanks in advance to those who can offer some advice.
I'd like to create a Flash Video Gallery with thumbnails that link to video and play on the page. Only one video screen. Something like Youtube.
I'm new to Dreamweaver and have built everything else for the site and the portfolio is the last page where I need to have the video gallery.
Any tutorials and direction is appreciated.
Again, I'd like to have one page with thumbnails that plays the video on the page in one window, not multiple windows.
Thanks!Wimpy Rave is absolutely perfect for this type of video gallery. One media player can handle all your video and audio files seemlessly from a playlist.
See Examples, Rave Video Playlist.
http://www.wimpyplayer.com/affiliates/idevaffiliate.php?id=836
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb -
Need help with xml video gallery
Hello everyone
I recently bought a xml video gallery. I'm loading the movie externally into another movie. When the xml gallery loads, it cancels all sounds.
I need to figure out where in the actionscription can i reverse the cancellation of sounds. Can anyone help? if possible, I can email, whomever is willing to help, the xml gallery to see if theres another reason the sound is being canceled.
Also, the sound of the gallery doesn't work til you click the volume scroller.
Here are two parts of actionscript included in the gallery:
part one:
// Import filter classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
// Set flash variables
var xmlFileUrl:String = "playlist.xml";
var auto_play:String = "true";
// Set xml file URL
if (_root.xmlfile) {
xmlFileUrl = _root.xmlfile;
var V_SRC;
var thuArray:Array = new Array();
var currentVideo:Number = 0;
var totalItems;
var numOfItems:Number;
var itemDistance:Number = 120+5;
var itemHeight:Number = 80+2;
var Value:Number = 1;
var boundry:Number = 1;
var ratio:Number = 1;
var diff:Number = 1;
var collectionWidth:Number = 1;
var buffer:Number = 135*2;
this.createEmptyMovieClip("video_txt",this.getNextHighestDepth());
video_txt.createTextField("theText",video_txt.getNextHighestDepth(),0,0,584,36);
video_txt.theText.selectable = false;
video_txt.theText.autoSize = "left";
//The Format
myFormat = new TextFormat();
myFormat.font = _root.font_format;
myFormat.size = _root.font_size;
myFormat.color = _root.font_color;
myFormat.align = "center";
video_txt.theText.setNewTextFormat(myFormat);
// Create a new movieclip to load the thumbs
var thumbLoader:MovieClipLoader = new MovieClipLoader();
var thumbListener:Object = new Object();
thumbLoader.addListener(thumbListener);
thumbListener.onLoadInit = function(target_mc:MovieClip, httpStatus:Number)
new Tween(target_mc, "_alpha", Regular.easeOut, 0, 100, 1, true);
target_mc._parent.preloader_mc._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = xmlLoaded;
xml.load(xmlFileUrl);
// Load the xml file into the player
function xmlLoaded(b:Boolean) {
if (b) {
auto_play = this.firstChild.firstChild.attributes.auto_play;
scrollSpeed = parseInt(this.firstChild.firstChild.attributes.scrollSpeed);
totalItems = this.firstChild.firstChild.childNodes;
numOfItems = totalItems.length;
for (j=0; j<numOfItems; j++) {
var i = player_mc.main_mc.collection_mc.attachMovie("mc_Thumb", "thumb_"+j, j);
i._x = itemDistance*j;
thumbLoader.loadClip(totalItems[j].attributes.thumb,i.loader_mc);
i.id = j;
i.videoTitle = totalItems[j].attributes.title;
i.videoUrl = totalItems[j].attributes.src;
// Create an event for thumb rollover
i.onRollOver = iRoll;
i.onRollOut = i.onReleaseOutside=iOut;
i.onRelease = iRelease;
thuArray[j] = i;
// default first video
collectionWidth = player_mc.main_mc.collection_mc._width;
currentVideo = 0;
V_SRC = thuArray[0].videoUrl;
changeVideo();
//scope._alpha = 100;
new Tween(scope, "_alpha", Regular.easeOut, 0, 100, 0.5, true);
else
trace("Error! xml file not loaded");
// onRollOver Events
function iRoll() {
player_mc.mc_title.title_txt.htmlText = totalItems[this.id].attributes.title;
this.light_mc.play();
function iRelease() {
currentVideo = this.id;
changeVideo();
function changeVideo() {
V_SRC = thuArray[currentVideo].videoUrl;
player_mc.loadVideo();
currentThumb();
player_mc.mc_title.title_txt.htmlText = thuArray[currentVideo].videoTitle;
video_txt.theText.text = totalItems[currentVideo].attributes.title;
player_mc.so.getVolume();
player_mc.playStatus = 1;
player_mc.checkStatus();
function nextVideo() {
if (currentVideo<(numOfItems-1)) {
currentVideo++;
} else {
currentVideo = 0;
changeVideo();
function currentThumb() {
for (i=0; i<thuArray.length; i++) {
if (i == currentVideo) {
thuArray[i].enabled = true;
// Mouse movement on rollover
this.onMouseMove = function() {
collectionWidth = player_mc.main_mc.collection_mc._width;
boundry = player_mc.main_mc.area_mc._width;
if ((player_mc.main_mc._ymouse>0) && (player_mc.main_mc._ymouse<itemHeight)) {
if ((player_mc.main_mc._xmouse>0) && (player_mc.main_mc._xmouse<boundry)) {
ratio = player_mc.main_mc._xmouse/boundry;
diff = (collectionWidth-boundry)+buffer;
Value = Math.floor((-ratio)*diff)+(buffer/2);
updateAfterEvent();
this.onEnterFrame = function() {
// Define movement area and speed
if (player_mc.main_mc.collection_mc._width>player_mc.main_mc.area_mc._width) {
player_mc.main_mc.collection_mc._x = Math.round((player_mc.main_mc.collection_mc._x)+((Value-player_mc.main_mc.collection_mc._ x)/scrollSpeed));
if (player_mc.main_mc.collection_mc._x>0) {
player_mc.main_mc.collection_mc._x = 0;
} else if (player_mc.main_mc.collection_mc._x<(player_mc.main_mc.area_mc._width-(player_mc.main_mc. collection_mc._width))) {
player_mc.main_mc.collection_mc._x = Math.round(player_mc.main_mc.area_mc._width-(player_mc.main_mc.collection_mc._width));
} else {
player_mc.main_mc.collection_mc._x = 0;
updateAfterEvent();
part two:
// Define flash variables
var video_url:String = "";
var tempx:Number = this._parent._x;
var tempy:Number = this._parent._y;
var timeCounter:Number = 0;
var timeInSeconds:Number = _root.time_counter;
// Object to listen to onStage Event
videoObj = vid.videoObj;
// Setting up the connection
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
// Buffer time
ns.setBufferTime (10);
videoObj.attachVideo (ns);
function loadVideo () {
video_url = _parent.V_SRC;
trace(video_url);
ns.play (video_url);
function checkStatus()
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("pause");
mc_playAgain._visible = false;
thumbs_out = false;
title_out = false;
else
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
} // end else if
if (so.getVolume() == 0)
controls_mc.mute_mc.gotoAndStop("mute");
else
controls_mc.mute_mc.gotoAndStop("on");
}; // End of the function
mc_playAgain._visible = false;
// Check Status of video
ns.onStatus = function (info)
if (info.code == "NetStream.Buffer.Empty")
mc_buffer._visible = true;
else if (info.code == "NetStream.Buffer.Full")
mc_buffer._visible = false;
else if (info.code == "NetStream.Play.Stop")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
else
trace;
} // end else if
mc_playAgain._visible = true;
mc_buffer._visible = false;
thumbs_out = true;
title_out = true;
checkStatus();
} // end else if
// Get info about video
ns.onMetaData = function(infoObject:Object)
FLVduration = infoObject["duration"];
relationshipW = infoObject.height / infoObject.width;
relationshipH = infoObject.width / infoObject.height;
if (Stage["displayState"] == "fullScreen")
largeSize ();
else
regularSize ();
if (_parent.auto_play == "false")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
mc_buffer._visible = false;
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
thumbs_out = true;
title_out = true;
_parent.auto_play = "true";
}// end else if
var videoInterval = setInterval(videoStatus, 100);
var amountLoaded;
var duration;
// videoStatus on load Event
function videoStatus()
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
controls_mc.mc_progress.mc_buff._width = amountLoaded * 250;
controls_mc.mc_progress.mc_played._x = ns.time / duration * 250;
controls_mc.mc_progress.mc_played._xscale = Math.round(ns.time*100/FLVduration);
}; // End of the function
function scrubIt()
ns.seek(Math.floor(controls_mc.mc_progress.mc_played._x / 250 * duration));
}; // End of the function
// video time
var time_interval:Number = setInterval(checkTime, 500, ns);
function checkTime(ns:NetStream) {
//current time
var ns_seconds:Number = ns.time;
var minutes:Number = Math.floor(ns_seconds/60);
var seconds = Math.floor(ns_seconds%60);
sec = seconds;
min = minutes;
if (sec<10) {
sec = "0"+sec;
if (min<10) {
min = "0"+min;
controls_mc.time_txt.time_1.text = min+":"+sec;
//total time
var minutes2:Number = Math.floor(FLVduration/60);
var seconds2 = Math.floor(FLVduration%60);
sec2 = seconds2;
min2 = minutes2;
if (sec2<10) {
sec2 = "0"+sec2;
if (min2<10) {
min2 = "0"+min2;
controls_mc.time_txt.time_2.text = min2+":"+sec2;
if (controls_mc.time_txt.time_2.text == "NaN:NaN") {
controls_mc.time_txt.time_2.text = "00:00";
setStage ();
// Object to listen onStage Event
var stageL:Object = new Object ();
// function respnsible for content alignment
function setStage ()
if (Stage["displayState"] == "fullScreen") {
tempx = this._parent._x;
tempy = this._parent._y;
this._parent._x = 0;
this._parent._y = 0;
vidBg_mc._x = 0;
vidBg_mc._y = 0;
mc_title._x = 0;
mc_title._y = -30;
slide_me._x = 0;
slide_me._y = 0;
vidBg_mc._width = Stage.width;
vidBg_mc._height = Stage.height;
mc_title._width = Stage.width;
mc_title._height = Stage.height / 20;
slide_me._width = Stage.width;
slide_me._height = Stage.height / 20;
vid._x = vid._y = 0;
largeSize ();
controls_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));
controls_mc._y = Math.round (Stage.height - 36);
mc_playAgain._x = Math.round ((Stage.width / 2) - (mc_playAgain._width / 2));
mc_playAgain._y = Math.round (Stage.height - 572);
thumbs_mc._x = Math.round ((Stage.width / 2) - (thumbs_mc._width / 2));
thumbs_mc._y = Math.round (Stage.height - 115);
main_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));;
hide_mc.onEnterFrame = function () {
timeCounter = timeCounter + 1;
if (timeCounter >= timeInSeconds * 30) {
timeCounter = 0;
controls_mc._alpha = 0;
this.onMouseMove = function () {
timeCounter = 0;
controls_mc._alpha = 100;
else
delete hide_mc.onEnterFrame;
delete this.onMouseMove;
controls_mc._alpha = 100;
this._parent._x = tempx;
this._parent._y = tempy;
vidBg_mc._width = 600;
vidBg_mc._height = 360;
mc_title._width = 600;
mc_title._height = 30;
slide_me._width = 600;
slide_me._height = 30;
vidBg_mc._x = vid._x = 0;
vidBg_mc._y = vid._y = 35;
mc_title._x = vid._x = 0;
mc_title._y = vid._x = -30;
slide_me._x = vid._x = 0;
slide_me._y = vid._y = 35;
regularSize ();
controls_mc._x = 0;
controls_mc._y = 395;
mc_playAgain._x = 243;
mc_playAgain._y = 158;
thumbs_mc._x = 0;
thumbs_mc._y = 316;
main_mc._x = 0;
main_mc._y = 406;
mc_buffer._x = Math.round (vidBg_mc._x + (vidBg_mc._width / 2));
mc_buffer._y = Math.round (vidBg_mc._y + (vidBg_mc._height / 2));
// to apply when stage (browser window) is resized or modified
stageL.onResize = function () {
setStage ();
// attaching object to the stage
Stage.addListener (stageL);
MovieClip.prototype.slide = function(yPos) {
this._y -= (this._y-yPos)/5;
// tilte actions
mc_title.onEnterFrame = function()
if (Stage["displayState"] == "normal" && title_out == false)
this.slide(5);
else if (Stage["displayState"] == "normal" && title_out == true)
this.slide(35);
if (Stage["displayState"] == "fullScreen" && title_out == false)
this._y -= (this._y+106)/5;
else if (Stage["displayState"] == "fullScreen" && title_out == true)
this.slide(0);
// thumbs actions
main_mc.onEnterFrame = function()
if (Stage["displayState"] == "normal" && thumbs_out == false)
this.slide(406);
else if (Stage["displayState"] == "normal" && thumbs_out == true)
this.slide(299);
if (Stage["displayState"] == "fullScreen" && thumbs_out == false)
this._y = Math.round (Stage.height - 0);
else if (Stage["displayState"] == "fullScreen" && thumbs_out == true)
this._y = Math.round (Stage.height - 133);
// Playlist button
controls_mc.playlist_mc.onRollOver = function ()
this.gotoAndStop("playlistOver");
controls_mc.playlist_mc.onRollOut = controls_mc.playlist_mc.onReleaseOutside = function ()
this.gotoAndStop("playlist");
// Toggle playlist button
controls_mc.playlist_mc.onRelease = function ()
if (thumbs_out == false)
thumbs_out = true;
title_out = true;
else if (thumbs_out == true)
thumbs_out = false;
title_out = false;
} // end if else
// Define hit area for playPause button
vid.onPress = controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("play")
playStatus = 0;
checkStatus();
else if (playStatus == 0)
controls_mc.playPause.gotoAndStop("pause");
playStatus = 1;
checkStatus();
// playPause button
controls_mc.playPause.onRollOver = function ()
if (playStatus == 1)
this.gotoAndStop("pauseOver");
else
this.gotoAndStop("playOver");
} // end else if
controls_mc.playPause.onRollOut = controls_mc.playPause.onReleaseOutside = function ()
if (playStatus == 1)
this.gotoAndStop("pause");
else
this.gotoAndStop("play");
} // end else if
// Toggle playPause button
controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
this.gotoAndStop("play");
playStatus = 0;
checkStatus();
else if (playStatus == 0)
this.gotoAndStop("pause");
playStatus = 1;
checkStatus();
controls_mc.skip_mc.onRollOver = function ()
this.gotoAndStop("skipOver");
controls_mc.skip_mc.onRollOut = controls_mc.skip_mc.onReleaseOutside = function ()
this.gotoAndStop("skip");
controls_mc.skip_mc.onRelease = function ()
_parent.nextVideo()
// Play Again button
mc_playAgain.onRollOver = function ()
this.gotoAndStop("playAgainOver");
mc_playAgain.onRollOut = mc_playAgain.onReleaseOutside = function ()
this.gotoAndStop("playAgain");
// Toggle Play Again button
mc_playAgain.onRelease = function ()
this._visible = false;
ns.pause();
playStatus = 1;
checkStatus();
// make the seek bar clickable
controls_mc.mc_progress.mc_buff.onPress = function()
xpos = controls_mc.mc_progress._xmouse;
percent = Math.round(xpos/controls_mc.mc_progress._width*100);
seekTime = percent/100*FLVduration;
seekTime = Math.round(seekTime*100)/100;
ns.seek(seekTime);
// Set volume level
var s:Sound = new Sound();
s.setVolume(_root.volume_value);
controls_mc.mc_soundLevel.mc_volume._xscale = _root.volume_value;
// Volume control
controls_mc.mc_soundLevel.onPress = function()
volumeTo = (this._xmouse / this._width)*100;
this.mc_volume._xscale = volumeTo;
s.setVolume(volumeTo);
// Volume
_parent.createEmptyMovieClip("vSound", _parent.getNextHighestDepth());
vSound.attachAudio(ns);
var so = new Sound(vSound);
so.setVolume(_root.volume_value);
// Mute button
controls_mc.mute_mc.onRollOver = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("onOver");
else
this.gotoAndStop("muteOver");
} // end else if
controls_mc.mute_mc.onRollOut = controls_mc.mute_mc.onReleaseOutside = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("on");
else
this.gotoAndStop("mute");
} // end else if
// Toggle mute button
controls_mc.mute_mc.onRelease = function ()
if (so.getVolume() >= 1)
controls_mc.mc_soundLevel.mc_volume._xscale = 0;
so.setVolume(0);
this.gotoAndStop("muteOver");
else
controls_mc.mc_soundLevel.mc_volume._xscale = 70;
so.setVolume(_root.volume_value);
this.gotoAndStop("onOver");
} // end else if
// Resize video proportionaly
function regularSize ()
videoObj._width = 600;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > 360)
videoObj._height = 360;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (600 - videoObj._width) / 2;
videoObj._y = (360 - videoObj._height) / 2;
function largeSize ()
videoObj._width = Stage.width;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > Stage.height)
videoObj._height = Stage.height;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (Stage.width - videoObj._width) / 2;
videoObj._y = (Stage.height - videoObj._height) / 2;
// Fullscreen button
controls_mc.fullscreen_mc.onRollOver = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("fullOver");
else
this.gotoAndStop("fullCloseOver");
} // end else if
controls_mc.fullscreen_mc.onRollOut = controls_mc.fullscreen_mc.onReleaseOutside = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("full");
else
this.gotoAndStop("fullClose");
} // end else if
// Toggle fullscreen button
controls_mc.fullscreen_mc.onRelease = function ()
if (Stage["displayState"] == "normal")
Stage["displayState"] = "fullscreen";
_parent.video_txt.theText._visible = false;
else
Stage["displayState"] = "normal";
_parent.video_txt.theText._visible = true;if you mean sound works well when the gallery is tested without being loaded into another swf but fails when loaded, change the highlighted line:
// Import filter classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
// Set flash variables
var xmlFileUrl:String = "playlist.xml";
var auto_play:String = "true";
// Set xml file URL
if (_root.xmlfile) {
xmlFileUrl = _root.xmlfile;
var V_SRC;
var thuArray:Array = new Array();
var currentVideo:Number = 0;
var totalItems;
var numOfItems:Number;
var itemDistance:Number = 120+5;
var itemHeight:Number = 80+2;
var Value:Number = 1;
var boundry:Number = 1;
var ratio:Number = 1;
var diff:Number = 1;
var collectionWidth:Number = 1;
var buffer:Number = 135*2;
this.createEmptyMovieClip("video_txt",this.getNextHighestDepth());
video_txt.createTextField("theText",video_txt.getNextHighestDepth(),0,0,584,36);
video_txt.theText.selectable = false;
video_txt.theText.autoSize = "left";
//The Format
myFormat = new TextFormat();
myFormat.font = _root.font_format;
myFormat.size = _root.font_size;
myFormat.color = _root.font_color;
myFormat.align = "center";
video_txt.theText.setNewTextFormat(myFormat);
// Create a new movieclip to load the thumbs
var thumbLoader:MovieClipLoader = new MovieClipLoader();
var thumbListener:Object = new Object();
thumbLoader.addListener(thumbListener);
thumbListener.onLoadInit = function(target_mc:MovieClip, httpStatus:Number)
new Tween(target_mc, "_alpha", Regular.easeOut, 0, 100, 1, true);
target_mc._parent.preloader_mc._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = xmlLoaded;
xml.load(xmlFileUrl);
// Load the xml file into the player
function xmlLoaded(b:Boolean) {
if (b) {
auto_play = this.firstChild.firstChild.attributes.auto_play;
scrollSpeed = parseInt(this.firstChild.firstChild.attributes.scrollSpeed);
totalItems = this.firstChild.firstChild.childNodes;
numOfItems = totalItems.length;
for (j=0; j<numOfItems; j++) {
var i = player_mc.main_mc.collection_mc.attachMovie("mc_Thumb", "thumb_"+j, j);
i._x = itemDistance*j;
thumbLoader.loadClip(totalItems[j].attributes.thumb,i.loader_mc);
i.id = j;
i.videoTitle = totalItems[j].attributes.title;
i.videoUrl = totalItems[j].attributes.src;
// Create an event for thumb rollover
i.onRollOver = iRoll;
i.onRollOut = i.onReleaseOutside=iOut;
i.onRelease = iRelease;
thuArray[j] = i;
// default first video
collectionWidth = player_mc.main_mc.collection_mc._width;
currentVideo = 0;
V_SRC = thuArray[0].videoUrl;
changeVideo();
//scope._alpha = 100;
new Tween(scope, "_alpha", Regular.easeOut, 0, 100, 0.5, true);
else
trace("Error! xml file not loaded");
// onRollOver Events
function iRoll() {
player_mc.mc_title.title_txt.htmlText = totalItems[this.id].attributes.title;
this.light_mc.play();
function iRelease() {
currentVideo = this.id;
changeVideo();
function changeVideo() {
V_SRC = thuArray[currentVideo].videoUrl;
player_mc.loadVideo();
currentThumb();
player_mc.mc_title.title_txt.htmlText = thuArray[currentVideo].videoTitle;
video_txt.theText.text = totalItems[currentVideo].attributes.title;
player_mc.so.getVolume();
player_mc.playStatus = 1;
player_mc.checkStatus();
function nextVideo() {
if (currentVideo<(numOfItems-1)) {
currentVideo++;
} else {
currentVideo = 0;
changeVideo();
function currentThumb() {
for (i=0; i<thuArray.length; i++) {
if (i == currentVideo) {
thuArray[i].enabled = true;
// Mouse movement on rollover
this.onMouseMove = function() {
collectionWidth = player_mc.main_mc.collection_mc._width;
boundry = player_mc.main_mc.area_mc._width;
if ((player_mc.main_mc._ymouse>0) && (player_mc.main_mc._ymouse<itemHeight)) {
if ((player_mc.main_mc._xmouse>0) && (player_mc.main_mc._xmouse<boundry)) {
ratio = player_mc.main_mc._xmouse/boundry;
diff = (collectionWidth-boundry)+buffer;
Value = Math.floor((-ratio)*diff)+(buffer/2);
updateAfterEvent();
this.onEnterFrame = function() {
// Define movement area and speed
if (player_mc.main_mc.collection_mc._width>player_mc.main_mc.area_mc._width) {
player_mc.main_mc.collection_mc._x = Math.round((player_mc.main_mc.collection_mc._x)+((Value-player_mc.main_mc.colle ction_mc._x)/scrollSpeed));
if (player_mc.main_mc.collection_mc._x>0) {
player_mc.main_mc.collection_mc._x = 0;
} else if (player_mc.main_mc.collection_mc._x<(player_mc.main_mc.area_mc._width-(player_m c.main_mc.collection_mc._width))) {
player_mc.main_mc.collection_mc._x = Math.round(player_mc.main_mc.area_mc._width-(player_mc.main_mc.collection_mc._w idth));
} else {
player_mc.main_mc.collection_mc._x = 0;
updateAfterEvent();
part two:
// Define flash variables
var video_url:String = "";
var tempx:Number = this._parent._x;
var tempy:Number = this._parent._y;
var timeCounter:Number = 0;
var timeInSeconds:Number = _root.time_counter;
// Object to listen to onStage Event
videoObj = vid.videoObj;
// Setting up the connection
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
// Buffer time
ns.setBufferTime (10);
videoObj.attachVideo (ns);
function loadVideo () {
video_url = _parent.V_SRC;
trace(video_url);
ns.play (video_url);
function checkStatus()
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("pause");
mc_playAgain._visible = false;
thumbs_out = false;
title_out = false;
else
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
} // end else if
if (so.getVolume() == 0)
controls_mc.mute_mc.gotoAndStop("mute");
else
controls_mc.mute_mc.gotoAndStop("on");
}; // End of the function
mc_playAgain._visible = false;
// Check Status of video
ns.onStatus = function (info)
if (info.code == "NetStream.Buffer.Empty")
mc_buffer._visible = true;
else if (info.code == "NetStream.Buffer.Full")
mc_buffer._visible = false;
else if (info.code == "NetStream.Play.Stop")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
else
trace;
} // end else if
mc_playAgain._visible = true;
mc_buffer._visible = false;
thumbs_out = true;
title_out = true;
checkStatus();
} // end else if
// Get info about video
ns.onMetaData = function(infoObject:Object)
FLVduration = infoObject["duration"];
relationshipW = infoObject.height / infoObject.width;
relationshipH = infoObject.width / infoObject.height;
if (Stage["displayState"] == "fullScreen")
largeSize ();
else
regularSize ();
if (_parent.auto_play == "false")
ns.seek(0);
if (playStatus == 1)
ns.pause();
playStatus = 0;
mc_buffer._visible = false;
controls_mc.playPause.gotoAndStop("play");
mc_playAgain._visible = true;
thumbs_out = true;
title_out = true;
_parent.auto_play = "true";
}// end else if
var videoInterval = setInterval(videoStatus, 100);
var amountLoaded;
var duration;
// videoStatus on load Event
function videoStatus()
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
controls_mc.mc_progress.mc_buff._width = amountLoaded * 250;
controls_mc.mc_progress.mc_played._x = ns.time / duration * 250;
controls_mc.mc_progress.mc_played._xscale = Math.round(ns.time*100/FLVduration);
}; // End of the function
function scrubIt()
ns.seek(Math.floor(controls_mc.mc_progress.mc_played._x / 250 * duration));
}; // End of the function
// video time
var time_interval:Number = setInterval(checkTime, 500, ns);
function checkTime(ns:NetStream) {
//current time
var ns_seconds:Number = ns.time;
var minutes:Number = Math.floor(ns_seconds/60);
var seconds = Math.floor(ns_seconds%60);
sec = seconds;
min = minutes;
if (sec<10) {
sec = "0"+sec;
if (min<10) {
min = "0"+min;
controls_mc.time_txt.time_1.text = min+":"+sec;
//total time
var minutes2:Number = Math.floor(FLVduration/60);
var seconds2 = Math.floor(FLVduration%60);
sec2 = seconds2;
min2 = minutes2;
if (sec2<10) {
sec2 = "0"+sec2;
if (min2<10) {
min2 = "0"+min2;
controls_mc.time_txt.time_2.text = min2+":"+sec2;
if (controls_mc.time_txt.time_2.text == "NaN:NaN") {
controls_mc.time_txt.time_2.text = "00:00";
setStage ();
// Object to listen onStage Event
var stageL:Object = new Object ();
// function respnsible for content alignment
function setStage ()
if (Stage["displayState"] == "fullScreen") {
tempx = this._parent._x;
tempy = this._parent._y;
this._parent._x = 0;
this._parent._y = 0;
vidBg_mc._x = 0;
vidBg_mc._y = 0;
mc_title._x = 0;
mc_title._y = -30;
slide_me._x = 0;
slide_me._y = 0;
vidBg_mc._width = Stage.width;
vidBg_mc._height = Stage.height;
mc_title._width = Stage.width;
mc_title._height = Stage.height / 20;
slide_me._width = Stage.width;
slide_me._height = Stage.height / 20;
vid._x = vid._y = 0;
largeSize ();
controls_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));
controls_mc._y = Math.round (Stage.height - 36);
mc_playAgain._x = Math.round ((Stage.width / 2) - (mc_playAgain._width / 2));
mc_playAgain._y = Math.round (Stage.height - 572);
thumbs_mc._x = Math.round ((Stage.width / 2) - (thumbs_mc._width / 2));
thumbs_mc._y = Math.round (Stage.height - 115);
main_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));;
hide_mc.onEnterFrame = function () {
timeCounter = timeCounter + 1;
if (timeCounter >= timeInSeconds * 30) {
timeCounter = 0;
controls_mc._alpha = 0;
this.onMouseMove = function () {
timeCounter = 0;
controls_mc._alpha = 100;
else
delete hide_mc.onEnterFrame;
delete this.onMouseMove;
controls_mc._alpha = 100;
this._parent._x = tempx;
this._parent._y = tempy;
vidBg_mc._width = 600;
vidBg_mc._height = 360;
mc_title._width = 600;
mc_title._height = 30;
slide_me._width = 600;
slide_me._height = 30;
vidBg_mc._x = vid._x = 0;
vidBg_mc._y = vid._y = 35;
mc_title._x = vid._x = 0;
mc_title._y = vid._x = -30;
slide_me._x = vid._x = 0;
slide_me._y = vid._y = 35;
regularSize ();
controls_mc._x = 0;
controls_mc._y = 395;
mc_playAgain._x = 243;
mc_playAgain._y = 158;
thumbs_mc._x = 0;
thumbs_mc._y = 316;
main_mc._x = 0;
main_mc._y = 406;
mc_buffer._x = Math.round (vidBg_mc._x + (vidBg_mc._width / 2));
mc_buffer._y = Math.round (vidBg_mc._y + (vidBg_mc._height / 2));
// to apply when stage (browser window) is resized or modified
stageL.onResize = function () {
setStage ();
// attaching object to the stage
Stage.addListener (stageL);
MovieClip.prototype.slide = function(yPos) {
this._y -= (this._y-yPos)/5;
// tilte actions
mc_title.onEnterFrame = function()
if (Stage["displayState"] == "normal" && title_out == false)
this.slide(5);
else if (Stage["displayState"] == "normal" && title_out == true)
this.slide(35);
if (Stage["displayState"] == "fullScreen" && title_out == false)
this._y -= (this._y+106)/5;
else if (Stage["displayState"] == "fullScreen" && title_out == true)
this.slide(0);
// thumbs actions
main_mc.onEnterFrame = function()
if (Stage["displayState"] == "normal" && thumbs_out == false)
this.slide(406);
else if (Stage["displayState"] == "normal" && thumbs_out == true)
this.slide(299);
if (Stage["displayState"] == "fullScreen" && thumbs_out == false)
this._y = Math.round (Stage.height - 0);
else if (Stage["displayState"] == "fullScreen" && thumbs_out == true)
this._y = Math.round (Stage.height - 133);
// Playlist button
controls_mc.playlist_mc.onRollOver = function ()
this.gotoAndStop("playlistOver");
controls_mc.playlist_mc.onRollOut = controls_mc.playlist_mc.onReleaseOutside = function ()
this.gotoAndStop("playlist");
// Toggle playlist button
controls_mc.playlist_mc.onRelease = function ()
if (thumbs_out == false)
thumbs_out = true;
title_out = true;
else if (thumbs_out == true)
thumbs_out = false;
title_out = false;
} // end if else
// Define hit area for playPause button
vid.onPress = controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
controls_mc.playPause.gotoAndStop("play")
playStatus = 0;
checkStatus();
else if (playStatus == 0)
controls_mc.playPause.gotoAndStop("pause");
playStatus = 1;
checkStatus();
// playPause button
controls_mc.playPause.onRollOver = function ()
if (playStatus == 1)
this.gotoAndStop("pauseOver");
else
this.gotoAndStop("playOver");
} // end else if
controls_mc.playPause.onRollOut = controls_mc.playPause.onReleaseOutside = function ()
if (playStatus == 1)
this.gotoAndStop("pause");
else
this.gotoAndStop("play");
} // end else if
// Toggle playPause button
controls_mc.playPause.onRelease = function ()
ns.pause();
if (playStatus == 1)
this.gotoAndStop("play");
playStatus = 0;
checkStatus();
else if (playStatus == 0)
this.gotoAndStop("pause");
playStatus = 1;
checkStatus();
controls_mc.skip_mc.onRollOver = function ()
this.gotoAndStop("skipOver");
controls_mc.skip_mc.onRollOut = controls_mc.skip_mc.onReleaseOutside = function ()
this.gotoAndStop("skip");
controls_mc.skip_mc.onRelease = function ()
_parent.nextVideo()
// Play Again button
mc_playAgain.onRollOver = function ()
this.gotoAndStop("playAgainOver");
mc_playAgain.onRollOut = mc_playAgain.onReleaseOutside = function ()
this.gotoAndStop("playAgain");
// Toggle Play Again button
mc_playAgain.onRelease = function ()
this._visible = false;
ns.pause();
playStatus = 1;
checkStatus();
// make the seek bar clickable
controls_mc.mc_progress.mc_buff.onPress = function()
xpos = controls_mc.mc_progress._xmouse;
percent = Math.round(xpos/controls_mc.mc_progress._width*100);
seekTime = percent/100*FLVduration;
seekTime = Math.round(seekTime*100)/100;
ns.seek(seekTime);
// Set volume level
var s:Sound = new Sound(this);
s.setVolume(_root.volume_value);
controls_mc.mc_soundLevel.mc_volume._xscale = _root.volume_value;
// Volume control
controls_mc.mc_soundLevel.onPress = function()
volumeTo = (this._xmouse / this._width)*100;
this.mc_volume._xscale = volumeTo;
s.setVolume(volumeTo);
// Volume
_parent.createEmptyMovieClip("vSound", _parent.getNextHighestDepth());
vSound.attachAudio(ns);
var so = new Sound(vSound);
so.setVolume(_root.volume_value);
// Mute button
controls_mc.mute_mc.onRollOver = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("onOver");
else
this.gotoAndStop("muteOver");
} // end else if
controls_mc.mute_mc.onRollOut = controls_mc.mute_mc.onReleaseOutside = function ()
if (so.getVolume() >= 1)
this.gotoAndStop("on");
else
this.gotoAndStop("mute");
} // end else if
// Toggle mute button
controls_mc.mute_mc.onRelease = function ()
if (so.getVolume() >= 1)
controls_mc.mc_soundLevel.mc_volume._xscale = 0;
so.setVolume(0);
this.gotoAndStop("muteOver");
else
controls_mc.mc_soundLevel.mc_volume._xscale = 70;
so.setVolume(_root.volume_value);
this.gotoAndStop("onOver");
} // end else if
// Resize video proportionaly
function regularSize ()
videoObj._width = 600;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > 360)
videoObj._height = 360;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (600 - videoObj._width) / 2;
videoObj._y = (360 - videoObj._height) / 2;
function largeSize ()
videoObj._width = Stage.width;
videoObj._height = videoObj._width * relationshipW;
if (videoObj._height > Stage.height)
videoObj._height = Stage.height;
videoObj._width = videoObj._height * relationshipH;
videoObj.smoothing = true;
//var scale:Number;
videoObj._x = (Stage.width - videoObj._width) / 2;
videoObj._y = (Stage.height - videoObj._height) / 2;
// Fullscreen button
controls_mc.fullscreen_mc.onRollOver = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("fullOver");
else
this.gotoAndStop("fullCloseOver");
} // end else if
controls_mc.fullscreen_mc.onRollOut = controls_mc.fullscreen_mc.onReleaseOutside = function ()
if (Stage["displayState"] == "normal")
this.gotoAndStop("full");
else
this.gotoAndStop("fullClose");
} // end else if
// Toggle fullscreen button
controls_mc.fullscreen_mc.onRelease = function ()
if (Stage["displayState"] == "normal")
Stage["displayState"] = "fullscreen";
_parent.video_txt.theText._visible = false;
else
Stage["displayState"] = "normal";
_parent.video_txt.theText._visible = true; -
Build a web gallery with amazing flash slideshows with dynamic XML files
Build a web gallery with amazing flash slideshows with dynamic XML files
Screenshot:
Features
Features
Transitions, zooming and panning effect You can choose from Random, Wipe from Left, Fade to White, Cross Expansion and other 60-plus transition effects. Zooming and panning effect is optional for advanced flash templates.
XML-driven This flash slideshow are XML-driven. The XML document allows more personalized controls over the flash.
Auto-playback and repeat mode The flash slideshow will play automatically after preloading, and it can repeat playback.
Dynamic customization Besides XML control, the advanced templates provide many more custom options, so that you can create slideshow that fits into your existing web design: width , height, border color, background color, thumbnail size, etc. More about dynamic customization
Usage and demo visit: http://webdesigndevelopment.blog.com...swf-xml-files/Please excuse the bump...
Anyone with a LR flash gallery that starts with slideshow in play mode?
Can it even be set to do this?
The only code in the style.xml that looks like it might be realted is line 12 <playOptions playMode="pause"/>, changing that to "play" does nothing.
Thanks,
Donnie
Maybe you are looking for
-
Log which records are exported?
Hello, On 11G: I'm using datapump to keep 2 databases in sync. When exporting data with expdp the query-parameter is used to filter data from the tables - not all data need to be synced all the time. Now I'm wondering if there is any way to log the n
-
I've been using Muse for 11 whole days now and while I'm really enjoying it, it is absolutely riddled with annoying little bugs and weird behaviours that have, by in large, been reported in the bugs section. Silly things like the states in the accord
-
File Associations to network shared virtual app?
We often use application virtualization for larger apps that would take too long to install via msi. We put those large virtual apps on a network share and users launch them from there rather than installing them locally. It's worked well for us, but
-
Hi, When I go to update my apps it asks me to sign in, however the login is wrong, it comes up with [email protected] when it should be [email protected] (note the email bit on the address is different). Then it keeps saying "your password was entere
-
Why is default URL created by iWeb Case Sensitive
I have posted a new website using iweb and it will only load if I use "Site" in the URL. If I type "site" Apple reports that no Website is available. Try it. http://web.mac.com/alan.fozzard/Site/Welcome.html http://web.mac.com/alan.fozzard/site/Welco