Video External List. (flv).
HI, How can I make a external flv list for flv playback play?Can I use XML or Java?Any exemple will be helpfull.... thanks
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 12-12-2005, 09:35 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Video + (list) Help Please
hi.
i'm trying to add the (list) component to a video player...
i have all of my info being read from a basic xml page
i want it to play three videos
<vid desc="video2 dark knight"
src="video/DK480p.mov" />
i can get the list to display the desc but i can not get it to play any video when i click the list.
i've been running in circles for hrs now and i could use some experienced eyes.
any help you can offer would be a huge help.
Attach Code
public class VideoJukebox_daily extends MovieClip {
/**
* The amount of time between calls to update the playhead timer, in
* milliseconds.
*/
const PLAYHEAD_UPDATE_INTERVAL_MS:uint = 10;
/**
* The path to the XML file containing the video playlist.
*/
const PLAYLIST_XML_URL:String = "playlist.xml";
/**
* The client object to use for the NetStream object.
*/
var client:Object;
/**
* The index of the currently playing video.
*/
var idx:uint = 0;
/**
* A copy of the current video's metadata object.
*/
var meta:Object;
var nc:NetConnection;
var ns:NetStream;
var playlist:XML;
var t:Timer;
var uldr:URLLoader;
var vid:Video;
var videosXML:XMLList;
/**
* Constructor
*/
public function VideoJukebox_daily() {
// Initialize the uldr variable which will be used to load the external
// playlist XML file.
uldr = new URLLoader();
uldr.addEventListener(Event.COMPLETE, xmlCompleteHandler);
uldr.load(new URLRequest(PLAYLIST_XML_URL));
vid_select.addEventListener(Event.CHANGE, clickit);
}
////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////// PROBLEM I THINK
////////////////////////////////////////////////////////////////////////////////////
function clickit(e:Event) {
trace( "select a");
ns.play(vid_select.getItemAt(vid_select.selectedIndex).data);
}
////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////// PROBLEM I THINK
////////////////////////////////////////////////////////////////////////////////////
/**
* Once the XML file has loaded, parse the file contents into an XML object,
* and create an XMList for the video nodes in the XML.
*/
function xmlCompleteHandler(event:Event):void {
playlist = XML(event.target.data);
videosXML = playlist.vid;
main();
/////////******************** PASS TITLE / VIDEO TO LIST
for (var i=0; i<playlist.vid.length(); i++) {
vid_select.addItem({label:playlist.vid[i].@desc, data:playlist.vid[i].@src});
}
vid_select.selectedIndex = 0;
//playlist.ignoreWhitespace = true;
}
/**
* The main application.
*/
function main():void {
// Create the client object for the NetStream, and set up a callback
// handler for the onMetaData event.
client = new Object();
client.onMetaData = metadataHandler;
nc = new NetConnection();
nc.connect(null);
// Initialize the NetSteam object, add a listener for the netStatus
// event, and set the client for the NetStream.
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
ns.client = client;
// Initialize the Video object, attach the NetStram, and add the Video
// object to the display list.
vid = new Video();
vid.attachNetStream(ns);
/**
* Event listener for the ns object. Called when the net stream's status
* changes.
*/
function netStatusHandler(event:NetStatusEvent):void {
try {
switch (event.info.code) {
case "NetStream.Play.Start" :
// If the current code is Start, start the timer object.
t.start();
break;
case "NetStream.Play.StreamNotFound" :
case "NetStream.Play.Stop" :
// If the current code is Stop or StreamNotFound, stop
// the timer object and play the next video in the playlist.
t.stop();
playNextVideo();
break;
}
} catch (error:TypeError) {
// Ignore any errors.
}
}
/**
* Event listener for the ns object's client property. This method is called
* when the net stream object receives metadata information for a video.
*/
function metadataHandler(metadataObj:Object):void {
// Store the metadata information in the meta object.
meta = metadataObj;
}
/**
* Retrieve the current video from the playlist XML object.
*/
function getVideo():String {
return videosXML[idx].@src;
}
/**
* Play the currently selected video.
*/
function playVideo():void {
var src:String = getVideo();
ns.play(src);
}
/**
* Increase the current video index and begin playback of the video.
*/
function playNextVideo():void {
if (idx < (videosXML.length() - 1)) {
// If this is not the last video in the playlist increase the
// video index and play the next video.
idx++;
playVideo();
// Make sure the positionBar progress bar is visible.
//positionBar.visible = true;
} else {
// If this is the last video in the playlist increase the video
// index, clear the contents of the Video object and hide the
// positionBar progress bar. The video index is increased so that
// when the video ends, clicking the backButton will play the
// correct video.
idx++;
vid.clear();
}
}
}
}
Video + (list) Help Please
hi.
i'm trying to add the (list) component to a video player...
i have all of my info being read from a basic xml page
i want it to play three videos
<vid desc="video2 dark knight"
src="video/DK480p.mov" />
i can get the list to display the desc but i can not get it to play any video when i click the list.
i've been running in circles for hrs now and i could use some experienced eyes.
any help you can offer would be a huge help.
Code:
public class VideoJukebox_daily extends MovieClip {
/**
* The amount of time between calls to update the playhead timer, in
* milliseconds.
*/
const PLAYHEAD_UPDATE_INTERVAL_MS:uint = 10;
/**
* The path to the XML file containing the video playlist.
*/
const PLAYLIST_XML_URL:String = "playlist.xml";
/**
* The client object to use for the NetStream object.
*/
var client:Object;
/**
* The index of the currently playing video.
*/
var idx:uint = 0;
/**
* A copy of the current video's metadata object.
*/
var meta:Object;
var nc:NetConnection;
var ns:NetStream;
var playlist:XML;
var t:Timer;
var uldr:URLLoader;
var vid:Video;
var videosXML:XMLList;
/**
* Constructor
*/
public function VideoJukebox_daily() {
// Initialize the uldr variable which will be used to load the external
// playlist XML file.
uldr = new URLLoader();
uldr.addEventListener(Event.COMPLETE, xmlCompleteHandler);
uldr.load(new URLRequest(PLAYLIST_XML_URL));
vid_select.addEventListener(Event.CHANGE, clickit);
}
////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////// PROBLEM I THINK
////////////////////////////////////////////////////////////////////////////////////
function clickit(e:Event) {
trace( "select a");
ns.play(vid_select.getItemAt(vid_select.selectedIndex).data);
}
////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////// PROBLEM I THINK
////////////////////////////////////////////////////////////////////////////////////
/**
* Once the XML file has loaded, parse the file contents into an XML object,
* and create an XMList for the video nodes in the XML.
*/
function xmlCompleteHandler(event:Event):void {
playlist = XML(event.target.data);
videosXML = playlist.vid;
main();
/////////******************** PASS TITLE / VIDEO TO LIST
for (var i=0; i<playlist.vid.length(); i++) {
vid_select.addItem({label:playlist.vid[i].@desc, data:playlist.vid[i].@src});
}
vid_select.selectedIndex = 0;
//playlist.ignoreWhitespace = true;
}
/**
* The main application.
*/
function main():void {
// Create the client object for the NetStream, and set up a callback
// handler for the onMetaData event.
client = new Object();
client.onMetaData = metadataHandler;
nc = new NetConnection();
nc.connect(null);
// Initialize the NetSteam object, add a listener for the netStatus
// event, and set the client for the NetStream.
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
ns.client = client;
// Initialize the Video object, attach the NetStram, and add the Video
// object to the display list.
vid = new Video();
vid.attachNetStream(ns);
/**
* Event listener for the ns object. Called when the net stream's status
* changes.
*/
function netStatusHandler(event:NetStatusEvent):void {
try {
switch (event.info.code) {
case "NetStream.Play.Start" :
// If the current code is Start, start the timer object.
t.start();
break;
case "NetStream.Play.StreamNotFound" :
case "NetStream.Play.Stop" :
// If the current code is Stop or StreamNotFound, stop
// the timer object and play the next video in the playlist.
t.stop();
playNextVideo();
break;
}
} catch (error:TypeError) {
// Ignore any errors.
}
}
/**
* Event listener for the ns object's client property. This method is called
* when the net stream object receives metadata information for a video.
*/
function metadataHandler(metadataObj:Object):void {
// Store the metadata information in the meta object.
meta = metadataObj;
}
/**
* Retrieve the current video from the playlist XML object.
*/
function getVideo():String {
return videosXML[idx].@src;
}
/**
* Play the currently selected video.
*/
function playVideo():void {
var src:String = getVideo();
ns.play(src);
}
/**
* Increase the current video index and begin playback of the video.
*/
function playNextVideo():void {
if (idx < (videosXML.length() - 1)) {
// If this is not the last video in the playlist increase the
// video index and play the next video.
idx++;
playVideo();
// Make sure the positionBar progress bar is visible.
//positionBar.visible = true;
} else {
// If this is the last video in the playlist increase the video
// index, clear the contents of the Video object and hide the
// positionBar progress bar. The video index is increased so that
// when the video ends, clicking the backButton will play the
// correct video.
idx++;
vid.clear();
}
}
}
}
LIST And VIDEO LAYERS
I had the beginnings of a nice video all ready to go and then attempted to adjust the video size and move the list over just a little. What happens next. There is a HUGE gap between the video and list as well as the skin disappearing and I would hate to have to do it all over again because it takes so long to get it right. U can see a sample at http://www.holisticperspective.net/index1.html
uuurrrhhh.
Xml In Video List And Dyn Text
Yes, another question regarding the XML video playlist. I think this one is not too difficult, but XML in Flash is new to me, and I am technically running before I can walk :cry:. Any assistance would be greatly appreciated, or please let me know what other info I need to provide.
I have completed Lee's XML Video Playlist tutorial, and all worked fine. Based on this, I have created a mock-up to show my manager, as a prototype video controller/selector to show low-res versions of the videos my dept. creates. However, I am having trouble getting the mock-up to do what I need.
First off, here is the XML -- based on the file used on Lee's tutorial (but obviously kind of simplified):
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<videos>
<video url="video1.flv" desc="First Video" title="The first video" charge="ABC123" longdesc="This is a video that we created a while back" />
<video url="video1.flv" desc="Second Video" title="The second video" charge="ABC124" longdesc="This is another video" />
<video url="video1.flv" desc="Third Video" title="The third video" charge="ABC125" longdesc="This is "This is another video" />
<video url="video1.flv" desc="Fourth Video" title="The fourth video" charge="ABC126" longdesc="This is "This is another video" />
<video url="video1.flv" desc="Fifth Video" title="The fifth video" charge="ABC127" longdesc="This is "This is another video" />
</videos>
Here is the AS in my simplified mock-up:
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myVideo.attachVideo(ns);
//play and pause buttons
play_btn.onRelease = function() {
ns.pause(false);
}
pause_btn.onRelease=function() {
ns.pause(true);
}
//xml video list (videos.xml)
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(videos[i].attributes.desc,videos[i].attributes.url);
}
videoList.selectedIndex = 0;
}
var vidList:Object = new Object();
vidList.change = function() {
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
}
videoList.addEventListener("change",vidList);
vlist.load("videos.xml");
I have on the stage a video object (instance name=myVideo), the list component like in the tutorial (videoList), a play button (play_btn) and a pause button (pause_btn). Finally, I have a movieclip (info_mc), which holds 3 dynamic text boxes: to display the selected videos title (title_txt), charge code (charge_txt), and a long description (longDesc_txt) (sorry, cannot post).
Again, the video list loads and works properly. What I would like to do is feed text from the XML file into these dynamic text boxes, and cannot for the life of me get this to work. Should these 3 additional pieces of information (title, charge, and long description) appear as additional attributes of the video element in the XML file (as shown above) , or is it better to add elements within the video element for <title>, <charge>, and <longdesc>? Once there, how do I get this info to appear in the text boxes, and change depending upon the video that is selected? Can anyone point me in the right direction? Thanks!
I also have to apologize. I submitted an entry like this a while back, woefully lacking in details, and rightly received no replies. I hope this one is better. My apologies for creating a new entry, if that is not the preferred method. Wanted to basically pretend my old entry did not exist.
-- Pat
XML Video W/out List Component
Hey everyone, I'm trying to modify Lee's video XML file to have dynamic text boxes load in the video description instead of the list component, and I also have my flv's in a folder near the swf and fla, so they're not url's. I cannot get the text or the flv's to load and I've searched the forum for previous posts but didn't see anything similar to my situation. I'm new to the coding world! Can anyone help me?
Here are the files:
http://www.yousendit.com/transfer.php?a ... E26484F1EA
Thumbnails With Lee's Video XML List
How do you make it to where when the mouse hovers over a video in the list, a thumbnail shows in the caption box that Lee has on his site.
Thanks!
Buffer + XML Video List?
Im having an small problem, after i did the "buffer" tutorial, after that i did the xml tut and there are no problems the only thing is that only the first video appear with the buffer image and when i select the other videos they dont have the buffer image with them.
and here is my action script thanks for the help
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTIme(30);
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Play.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 * 358.9;
loader.scrub._x = ns.time / duration * 358.9;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,355,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/355)*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("-=Copyright 2006/7 Latin Soldiers=-",trace,true);
theMenu.customItems[3] = i4;
var i5:ContextMenuItem = new ContextMenuItem("-=TESTING=-",trace,true);
theMenu.customItems[4] = i5;
function pauseIt() {
ns.pause();
}
function replayIt() {
ns.seek(0);
}
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(videos[i].attributes.desc,videos[i].attributes.url);
}
ns.play(videoList.getItemAt(0).data);
videoList.selectedIndex = 0;
}
var vidList:Object = new Object();
vidList.change = function() {
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
}
videoList.addEventListener("change",vidList);
vlist.load("video.xml");
Play Next Video In List...
Hello all! I set up an XML playlist that has about 11 videos in it. What I would like flash to do is play each video, one after the other. Right now, it defaults to playing the same video over and over. I think I've seen this question before, but I can't seem to find it, and the search bar provided no help. Thanks in advance to anyone who is willing to help!
BC
XML Video List Box Not Populating
I've tried the xml video tutorial and the list box component is not populating. Still not finding the error. Listed below is the code. If anyone could help, I'd appreciate it.
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(10);
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.Play.Stop") {
ns.seek(0);
}
}
oVideo.attachVideo(ns);
//ns.play("test.flv");
//rewind button
vRewind.onRelease = function() {
ns.seek(0);
}
//play button
vPlay.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 * 211;
loader.scrubber._x = ns.time / duration * 211;
}
var scrubInterval;
loader.scrubber.onPress = function () {
clearInterval(videoInterval);
scrubInterval = setInterval(scrub, 10);
this.startDrag(false, 0, this._y, 208, this._y);
}
loader.scrubber.onRelease = loader.scrubber.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus, 100);
this.stopDrag();
}
function scrub() {
ns.seek(Math.floor((loader.scrubber._x/208) * duration));
}
var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu;
var i1 = new ContextMenuItem("::::::Video Controls::::::", trace);
theMenu.customItems[0] = i1;
var i2 = new ContextMenuItem("Play/Pause Video", playPause, true);
theMenu.customItems[1] = i2;
var i3 = new ContextMenuItem("Replay Video", replayVideo);
theMenu.customItems[2] = i3;
var i4 = new ContextMenuItem("Copyright 2006 Lee", trace);
theMenu.customItems[3] = i4;
function playPause() {
ns.pause();
}
function replayVideo() {
ns.seek(0);
}
//sound controls
_root.creatEmptyMovieClip("vSound", _root.getNextHighestDepth());
vSound.attachAudio(ns);
var so:Sound = new Sound(vSound);
so.setVolume(100);
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");
}
}
//xml connection and listbox population
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(videos[i].attributes.desc, videos[i].attributes.url);
}
ns.play(videoList.getItemAt(0).data);
videoList.selectedIndex = 0;
var vidList:Object = new Object();
vidList.change = function() {
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
}
videoList.addEventListener("change", vidList);
vlist.load("videos.xml");
Here is the xml part:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<videos>
<video url="test.flv" desc="Test" />
<video url="test.flv" desc="Test" />
<video url="test.flv" desc="Test" />
<video url="test.flv" desc="Test" />
</videos>
Thanks again.
XML Video List Tutorial
I was looking to use this in an upcoming project, but i can't get the video to not play right away. How can i change it so that it won't start immediatley after it buffers enough video?
Flash Video Thumbnail In A Box List
I'm trying to figure out how to put some thumbnails into a sort of box list. As an example http://abc.go.com/primetime/lost/lostandfound/index if you click on any of the episode from the "Episode" button, you will see on the right hand side that there are a bunch of thumbnails and each one of them has a link.
Does anyone have any idea?
Automatically Play Next Video In List?
I basically combined the "Creating a Dynamic Playlist for Streaming Flash Video" tutorial and the "Creating a Dynamic Playlist for Progressive Flash Video" on the Adobe website. you can check it out here: www.msu.edu/~blackbr4/maz
When the current video playing stops, I would like the next one in the list to automatically start. I know this would be easy if all the files were just embedded or something, but I'm using an external XML file to generate the list, so I dont know what code I would have to add to tell it to play the next listitem in the XML file. Any help would be greatly appreciated!
Edited: 05/15/2007 at 07:31:16 AM by northviper
Thumbnails Won't Load From Xml To List For Video
I am working on a project that will show the thumbnails on the right, and when one is selected, it will load the video to the left.
My work in progress can be viewed at www.fimm.tv, see code attached.
The xml file, flv file .live in the same folder, and the xml file is this
<?xml version="1.0" encoding="ISO-8859-1"?>
<videos>
<video url="test.flv" desc="Linda" /></video>
<video url="test.flv" desc="1" />
<video url="test.flv" desc="2" />
<video url="test.flv" desc="3" />
</videos>
I am following an awesome tutorial found on the web and this has helped me a great deal so far. Can anyone spot why my text is not displaying.
All help appreciated
Attach Code
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
video.attachVideo(stream_ns);
//stream_ns.play("test.flv");
rewindButton.onRelease = function() {
stream_ns.seek(0);
}
playButton.onRelease = function() {
stream_ns.pause();
}
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(videos[i].attributes.desc,videos[i].attributes.url);
}
stream_ns.play(videolist.getItemAt(0).data) ;
videoList.selectedItem = 0;
var vidList:Object = new Object();
vidList.change = function() {
stream_ns.play (videoList.getItemAt(videoList.SelectedIndex).data);
}
videoList.addEventListener("change",vidList);
Using AS3 Tile List To Load Video?
I have set up a tile list that loads text when an image is clicked, but I would also like it to load a .flv video at the same time. (Unique text and unique video for each image clicked)
Anyone know if this is possible, or how to do it?
Attach Code
navbar_tl.addEventListener(Event.CHANGE, navbarClicked);
function navbarClicked(event:Event):void {
button_ta.text = event.target.selectedItem.data;
}
navbar_tl.addItem({source:"introduction.jpg", data:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ultricies luctus felis. Duis enim. "});
navbar_tl.addItem({source:"the_problem.jpg", data:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ultricies luctus felis. Duis enim. "});
navbar_tl.addItem({source:"solution-criteria.jpg", data:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ultricies luctus felis. Duis enim. "});
Random Video Play List
I am working on my xml video play list. But I want to auto play songs after one another. How can i do that. Here is my code. If anyone could help me
stop();
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
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(videos[i].attributes.desc,videos[i].attributes.url);
}
i = 0;
if (i<0){
i++
}
ns.play(videoList.getItemAt(i).data);
ns.seek(2);
videoList.selectedIndex = i;
}
var vidList:Object = new Object();
vidList.change = function() {
ns.play(videoList.getItemAt(videoList.selectedInde x).data);
}
videoList.addEventListener("change",vidList);
vlist.load("videos.xml");
Advanced Video List With Buttons (up And Down)
Hello again,
Finally got some time of from homework and tests so I've been working with my media player again.
Anyways, I've been adding two buttons to the video list from Todd Lajoie videoList tutorial. And I can get the buttons to alpha down if your at the top and the other way around. But I want them to be clickable. so instead of a scrolling panel I wanna get a panel you can click up and down. Like the one at http://www.gametrailers.com/ (but that list move left and right)
Anyways is there an easy way to add a command that will move the list down to the next part?
Heres the code that I got:
Code:
var vlist:XML = new XML();
vlist.ignoreWhite = true;
var listClips:Array = new Array;
var whoIsOn:Number = 0;
var yBegin:Number = videoList._y;
vlist.onLoad = function() {
var videos:Array = this.firstChild.childNodes;
for(i=0;i<videos.length;i++) {
var a = videoList.attachMovie("listEntry", "listEntry"+i, videoList.getNextHighestDepth());
listClips.push(a);
a._y = a._height*i;
a._alpha = 100;
loadMovie(videos[i].attributes.thumb, a.tHolder);
a.vName.text = videos[i].attributes.name;
a.vDesc.text = videos[i].attributes.desc;
a.numb = i;
a.urlLink = videos[i].attributes.url
a.yLoc = (yBegin + (mask._height/2)) - (a._y + (a._height/2));
a.onRelease = function() {
getNewVid(this)
}
a.onRollOver = function() {
if (this.numb <> whoIsOn) {
this._alpha = 100;
this.onover._alpha = 100;
this.butt._alpha = 0;
this.butttext._alpha = 0;
this.accent._alpha = 100;
this.back._alpha = 0;
}
}
a.onRollOut = a.onReleaseOutside = function() {
if (this.numb <> whoIsOn) {
this._alpha = 100;
this.butt._alpha = 0;
this.onover._alpha = 0;
this.butttext._alpha = 0;
this.accent._alpha = 0;
this.back._alpha = 100;
}
}
a.onRelease = function() {
if (this.numb <> whoIsOn) {
this.butt._alpha = 100;
this.onover._alpha = 0;
getNewVid(this);
PB.gotoAndStop("on");
isPlaying = true;
}
}
}
yEnd = yBegin - videoList._height + mask._height + 5;
getNewVid(listClips[whoIsOn]);
}
vlist.load("videos.xml");
videoList.onRollOver = scrollPanel;
function panelOver() {
speed = 9;
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = mask.getBounds(_root);
function scrollPanel() {
if (_xmouse<b.xMin||_xmouse>b.xMax||_ymouse<b.yMin||_ymouse>b.yMax) {
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
var yDist = _ymouse - 200;
videoList._y += -yDist/speed;
if (videoList._y >= yBegin) {
videoList._y = yBegin;
up._alpha = 40;
}else {
up._alpha = 100;
}
if (videoList._y <= yEnd) {
videoList._y = yEnd;
down._alpha = 40;
} else {
down._alpha = 100;
}
}
function getNewVid(who) {
ns.play(who.urlLink);
whoIsOn = who.numb;
z = who.yLoc;
if (z >= yBegin) {
z = yBegin;
}
if (z <= yEnd) {
z = yEnd;
}
easeList(z);
for (i=0; i<listClips.length; i++) {
if ( listClips[i].numb == whoIsOn ) {
listClips[i]._alpha = 100;
listClips[i].frame._alpha = 100;
listClips[i].back._alpha = 0;
listClips[i].accent._alpha = 0;
}else {
listClips[i]._alpha = 100;
listClips[i].onover._alpha = 0;
listClips[i].butt._alpha = 0;
listClips[i].butttext._alpha = 0;
listClips[i].frame._alpha = 0;
listClips[i].back._alpha = 100;
listClips[i].accent._alpha = 0;
}
}
}
function easeList(where) {
delete videoList.onRollOver;
delete videoList.onEnterFrame;
videoList.onEnterFrame = function() {
yDist = (videoList._y - where)/7;
videoList._y-=yDist;
if ((videoList._y < (where+2)) && (videoList._y > (where-2))) {
delete videoList.onEnterFrame;
videoList.onRollOver = panelOver;
}
}
}
The only thing I added to Todd Lajoies code was this.
if (videoList._y >= yBegin) {
videoList._y = yBegin;
up._alpha = 40;
}else {
up._alpha = 100;
}
if (videoList._y <= yEnd) {
videoList._y = yEnd;
down._alpha = 40;
} else {
down._alpha = 100;
}
Video Basics (play Next In List)
Helo guys. I'm new here! I struggle a bit with the XML loaded Video player. Although it works fine.
But I just have this little question: I wanted it to play the next flv in the list, so far I got it so that I can determine whenever it's done playing.
I surely believe I wasn't the first one to ask this, but I've searched for a minute or ten that I gave up!
Code:
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
loader.stream._alpha = 20;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
loader.stream._alpha = 100;
}
if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
if(info.code == "NetStream.Play.Complete"){
???????????????????????????????????????
}
}
But what do I put at the questionmarks, so that it plays the next in the XML loaded list (videoList). Or am I taking this al the wrong way...
EDIT:
So far I came up with this code from the XML parser code in the tut!
Code:
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
loader.stream._alpha = 20;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
loader.stream._alpha = 100;
}
if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
if(info.code == "NetStream.Play.Complete"){
ns.play(videoList.getItemAt("NextItem").data);
videoList.selectedIndex = "NextItem";
}
}
Now I only have to do is play around with the NextItem code. Anyone have an idea, I've been browsing the Adobe website, but so far there's no sample to select the next item in the list with actionscript code...
LM
XML Video List With Long Description
I want to use Lee's XML video player, but also have an extra, longer description either in a text box below the playlist or as a tooltip. How can I do that?
Todd Lajoie XML Video List With Stylesheet?
Hello,
i tried to use one textfield in Todds video list modification which is formated with HTML und CSS.
The XML and html-tags are working now but i can´t use the stylesheet on my textfield.
the stylesheet was loaded too but it wont work.
Here is the relevant Code:
Code:
var myStyles:TextField.StyleSheet = new TextField.StyleSheet();
myStyles.onLoad = function(success:Boolean) {
if (success) {
trace("Styles loaded:");
} else {
trace("Error loading CSS");
}
};
myStyles.load("playlist.css");
var vlist:XML = new XML();
vlist.ignoreWhite = true;
var listClips:Array = new Array();
var whoIsOn:Number = 0;
var yBegin:Number = videoList._y;
vlist.onLoad = function() {
var videos:Array = this.firstChild.childNodes;
for (i=0; i<videos.length; i++) {
var a = videoList.attachMovie("listEntry", "listEntry"+i, videoList.getNextHighestDepth());
listClips.push(a);
a._y = a._height*i;
a._alpha = 66;
loadMovie(videos[i].attributes.thumb, a.tHolder);
a.vRubrik.html = true;
a.vRubrik.htmlText = videos[i].firstChild.nodeValue;
a.vRubrik.styleSheet = myStyles;
////////////////////////////////////////////
a.numb = i;
a.urlLink = videos[i].attributes.url;
a.yLoc = (yBegin+(mask._height/2))-(a._y+(a._height/2));
a.onRelease = function() {
getNewVid(this);
};
that´s my XML-CodeCode:
<?xml version="1.0" encoding="UTF-8"?>
<videos>
<video
thumb="thumbs/beauty/beauty_01.jpg"
url="psychotest/battle1.flv" >
<![CDATA[<b>People</b> 22.01.07<br><span class='videoTitle'>Dreamgirls</span> (inkl. Beyoncé-Interview)<br>Das Soul Trio Dreamgirls steigt in die Pop Charts der frühen 60er Jahre auf.]]>
</video>
</videos>
thats my cssCode:
.videoTitle {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
font-weight:bold;
color:#990000;
}
is anyone here, who could help me in this matter?
Help Regarding Todd Lajoie XML Video List Modification
First off I would like to say thank you to Lee and all the moderators. This is a great site.
I have completed Todd Lajoie's Modifications to Lee's NetStream Video Player: http://www.gotoandlearn.com/forum/viewtopic.php?t=3941
Which was excellent. I have got everything to work except for the the dynamic text to appear. I figure I just need a second pair of eyes to see the small mistake I am overlooking.
Here is the XML:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<videos>
<video
name="Fun Waimea Bay"
desc="Matt messes around in some small Waimea shorebreak"
url="bb.flv" thumb="bb1.jpg" />
<video
name="Big Island Rippers"
desc="Kainoa and the Big Island Bodyboarders rip to Pepper's Kona Town"
url="kainoa.flv" thumb="kainoa.jpg" />
<video
name="Chris Taloa"
desc="You may remember him as the dick surfer in Blue Crush, but he's actually a bodyboarder."
url="taloa.flv" thumb="taloa.jpg" />
<video
name="Tahiti"
desc="Tahiti. Nothing else to say about that."
url="tahiti.flv" thumb="tahiti.jpg" />
</videos>
Here is the actionscript:
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.setBufferTime(10);
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.Play.Stop") {
v = whoIsOn+1
if (v >= listClips.length ) {
v = 0;
}
getNewVid(listClips[v]);
}
}
playButton.onRelease = function() {
ns.pause();
}
rewindButton.onRelease = function() {
ns.seek(0);
}
this.createEmptyMovieClip("vFrame",this.getNextHighestDepth());
vFrame.onEnterFrame = videoStatus;
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 208.9;
loader.scrub._x = ns.time / duration * 208.9;
}
var scrubInterval;
loader.scrub.onPress = function() {
vFrame.onEnterFrame = scrubit;
this.startDrag(false,0,this._y,208,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
vFrame.onEnterFrame = videoStatus;
this.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader.scrub._x/208)*duration));
}
var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu;
var item1:ContextMenuItem = new ContextMenuItem("::::: Video Controls :::::",trace);
theMenu.customItems[0] = item1;
var item2:ContextMenuItem = new ContextMenuItem("Play / Pause Video",pauseIt,true);
theMenu.customItems[1] = item2;
var item3:ContextMenuItem = new ContextMenuItem("Replay the Video",restartIt);
theMenu.customItems[2] = item3;
var item4:ContextMenuItem = new ContextMenuItem("? 2005 Lee Brimelow",trace,true);
theMenu.customItems[3] = item4;
function pauseIt() {
ns.pause();
}
function stopIt() {
ns.seek(0);
ns.pause();
}
function restartIt() {
ns.seek(0);
}
_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
vSound.attachAudio(ns);
var so:Sound = new Sound(vSound);
so.setVolume(100);
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");
}
}
var vlist:XML = new XML();
vlist.ignoreWhite = true;
var listClips:Array = new Array;
var whoIsOn:Number = 0;
var yBegin:Number = videoList._y;
vlist.onLoad = function() {
var videos:Array = this.firstChild.childNodes;
for(i=0;i<videos.length;i++) {
var a = videoList.attachMovie("listEntry", "listEntry"+i, videoList.getNextHighestDepth());
listClips.push(a);
a._y = a._height*i;
a._alpha = 66;
loadMovie(videos[i].attributes.thumb, a.tHolder);
a.vName.text = videos[i].attributes.name;
a.vDesc.text = videos[i].attributes.desc;
a.numb = i;
a.urlLink = videos[i].attributes.url
a.yLoc = (yBegin + (mask._height/2)) - (a._y + (a._height/2));
a.onRelease = function() {
getNewVid(this)
}
a.onRollOver = function() {
if (this.numb <> whoIsOn) {
this._alpha = 100;
this.accent._alpha = 100;
this.back._alpha = 0;
}
}
a.onRollOut = a.onReleaseOutside = function() {
if (this.numb <> whoIsOn) {
this._alpha = 66;
this.accent._alpha = 0;
this.back._alpha = 100;
}
}
a.onRelease = function() {
if (this.numb <> whoIsOn) {
getNewVid(this);
}
}
}
yEnd = yBegin - videoList._height + mask._height + 5;
getNewVid(listClips[whoIsOn]);
}
vlist.load("thumbvideos.xml");
videoList.onRollOver = scrollPanel;
function panelOver() {
speed = 10;
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = mask.getBounds(_root);
function scrollPanel() {
if (_xmouse<b.xMin||_xmouse>b.xMax||_ymouse<b.yMin||_ymouse>b.yMax) {
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
var yDist = _ymouse - 250;
videoList._y += -yDist/speed;
if (videoList._y >= yBegin) {
videoList._y = yBegin;
}
if (videoList._y <= yEnd) {
videoList._y = yEnd;
}
}
function getNewVid(who) {
ns.play(who.urlLink);
whoIsOn = who.numb;
z = who.yLoc;
if (z >= yBegin) {
z = yBegin;
}
if (z <= yEnd) {
z = yEnd;
}
easeList(z);
for (i=0; i<listClips.length; i++) {
if ( listClips[i].numb == whoIsOn ) {
listClips[i]._alpha = 100;
listClips[i].frame._alpha = 100;
listClips[i].back._alpha = 0;
listClips[i].accent._alpha = 0;
}else {
listClips[i]._alpha = 66;
listClips[i].frame._alpha = 0;
listClips[i].back._alpha = 100;
listClips[i].accent._alpha = 0;
}
}
}
function easeList(where) {
delete videoList.onRollOver;
delete videoList.onEnterFrame;
videoList.onEnterFrame = function() {
yDist = (videoList._y - where)/7;
videoList._y-=yDist;
if ((videoList._y < (where+2)) && (videoList._y > (where-2))) {
delete videoList.onEnterFrame;
videoList.onRollOver = panelOver;
}
}
}
And here is the the whole package I have created in Flash 8:
http://equalitydesigns.com/art/video.zip
Any help would be great.
Thanks!
Custom Thumbnail Scrolling Video List
I have two questions on the "Modifications to Lee's NetStream Video Player". I worked through the tutorial on the Custom Thumbnail Scrolling video List. all the functionality worked apart from
1- the thumb nails dont show up in the swa, and
2- In my list of videos I get "underfined" in every second listEntry
(output panel gives me the error- Error opening url "file:........./underfined")
cant figure it out
I have searched though the forums.
any simple solutions?
XML Video Playlist... List Component Not Reading Xml
I've gone through the 8 different video basic tutorials successfully and I just tried completing the XML Video Playlist tutorial without results. I can't get my list component to populate with my XML file values and I'm at a loss as to why.
I've already gone through the forums and found some tweaks to the scrubber bar and that works great but I still cannot get my list component to populate with my xml file information.
I'll post my current code and if someone has a solution I'd be forever in debt.
Thank you.
////////////////////////// -- begin code -- ////////////////////////
Code:
playButton._visible = false;
replay._visible = false;
// disable default menu
var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu
// end disable default menu
// context menu items
/*
var item1:ContextMenuItem = new ContextMenuItem("::::: Video Controls :::::", trace, true);
theMenu.customItems [0] = item1;
var item2:ContextMenuItem = new ContextMenuItem("Play / Pause Video", pauseIt, true);
theMenu.customItems [1] = item2;
var item3:ContextMenuItem = new ContextMenuItem("Replay Video", replayIt);
theMenu.customItems [2] = item3;
*/
var item4:ContextMenuItem = new ContextMenuItem(":::::: Copyright 2006 ::::::", trace);
theMenu.customItems [3] = item4;
var item5:ContextMenuItem = new ContextMenuItem("____ Matt Blubaugh ____", trace);
theMenu.customItems [4] = item5;
// end context menu items
// context menu functions
function pauseIt()
{
ns.pause();
}
function replayIt()
{
ns.seek(0);
}
// end context menu functions
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
// buffer screen text and controls
ns.setBufferTime(7);
ns.onStatus = function(info)
{
if(info.code == "NetStream.Buffer.Full")
{
bufferClip._visible = false;
replay._visible = false;
}
// when buffer is empty, display buffer movie clip
if(info.code == "NetStream.Buffer.Empty")
{
bufferClip._visible = true;
}
// loop the video when it reaches the end
if(info.code == "NetStream.Play.Stop")
{
var t = videoList.selectedIndex + 1;
if (t < videoList.length) {
ns.play(videoList.getItemAt(t).data);
videoList.selectedIndex = t;
}
//replay._visible = true;
}
}
// replay button
replay.replayText.onRollOver = function()
{
this.gotoAndStop("over");
}
replay.replayText.onRollOut = function()
{
this.gotoAndStop("up");
}
replay.replayText.onRelease = function()
{
ns.seek(0);
}
// end replay button
// end buffer screen text and controls
/*
//attach video
theVideo.attachVideo(ns);
ns.play("blubaughmononoke.flv");
//end attach video
*/
// button rollovers, rollouts
rewindButton.onRollOver = over;
rewindButton.onRollOut = out;
playButton.onRollOver = over;
playButton.onRollOut = out;
pauseButton.onRollOver = over;
pauseButton.onRollOut = out;
function over ()
{
this.gotoAndStop("overState");
}
function out ()
{
this.gotoAndStop("upState");
}
// end button rollovers, rollouts
// button functions
rewindButton.onRelease = function()
{
ns.seek(0);
}
playButton.onRelease = function()
{
playButton._visible = false;
pauseButton._visible = true;
ns.pause();
}
pauseButton.onRelease = function()
{
pauseButton._visible = false;
playButton._visible = true;
ns.pause();
}
// end button functions
// mute button
// strip audio into variable
_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth())
vSound.attachAudio(ns);
var s:Sound = new Sound(vSound);
s.setVolume(100);
muteButton.onRollOver = function()
{
if(s.getVolume() == 100)
{
this.gotoAndStop("onOver");
}
else
{
this.gotoAndStop("offOver");
}
}
muteButton.onRollOut = function()
{
if(s.getVolume() == 100)
{
this.gotoAndStop("on");
}
else
{
this.gotoAndStop("off");
}
}
muteButton.onRelease = function()
{
if(s.getVolume() == 100)
{
s.setVolume(0);
this.gotoAndStop("offOver");
}
else
{
s.setVolume(100);
this.gotoAndStop("onOver");
}
}
// end mute button
// loader properties
this.createEmptyMovieClip("vFrame",this.getNextHighestDepth());
vFrame.onEnterFrame = videoStatus;
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj)
{
duration = obj.duration;
}
function videoStatus()
{
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadBar._width = amountLoaded * 213.5;
loader.scrubber._x = ns.time / duration * 213.5;
}
loader.scrubber.onPress = function()
{
vFrame.onEnterFrame = scrubIt;
this.startDrag(false,1.5,this._y,213.5,this._y);
}
loader.scrubber.onRelease = loader.scrubber.onReleaseOutside = function()
{
vFrame.onEnterFrame = videoStatus;
this.stopDrag();
}
function scrubIt()
{
ns.seek(Math.floor((loader.scrubber._x / 213.5) * duration));
}
// end loader properties
[size=18][b]//----------------------------------- begin XML ---------------------[/b][/size]
// xml loading into list
// create xml object
var vList:XML = new XML();
// ignore spaces in xml file
vList.ignoreWhite = true;
vList.onLoad = function()
{
// create array and assign video tags from xml
var videos:Array = this.firstChild.childNodes;
// for loop receives label and then data
for(i=0;i<videos.length;i++)
{
videoList.addItem(videos[i].attributes.desc);
videoList.addItem(videos[i].attributes.url);
}
ns.play(videoList.getItemAt(0).data);
// highlight selected item
videoList.selectedIndex = 0;
}
var vidList:Object = new Object();
vidList.change = function()
{
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
}
videoList.addEventListener("change",vidList);
// load xml file
vList.load("xml/videos.xml");
// end load xml file
// end xml loading properties
videoList.setStyle("selectionColor",0xCCCCCC);
videoList.setStyle("textSelectedColor",0x000000);
videoList.setStyle("rollOverColor",0xCCCCCC);
//////////////////////////// -------- end code ---------- ////////////////////////////
XML File
<?xml version = "1.0" encoding = "ISO-8859-1"?>
<videos>
<video url="flvs/blubaughmononoke.flv" desc="Princess Mononoke" />
<video url="flvs/blubaughjanqstaa3.flv" desc="No Reason Why" />
</videos>
Showing Flash Video With A List Of Thumbnails Of Other Videos To See
I'm using Flash 8 pro on my mac and am desiring to setup a flash video player that also has a list of thumbnails images and descriptions of other videos you can click on to view. I'm wanting something with functionality similar to what you see here http://www.willitblend.com/videos.aspx?type=unsafe&video=zirconia
I tried the components from Proxus.com but I can' t get them to work and can't find a way to contact them.
Anyone know of a good solution for this?
Flash Video Player - Dynamic Menu List
All,
I'm a beginner to ActionScript, but know most of the other ins and outs of Flash Video. I'm trying to create a Dynamic FLV player similiar to the look and feel of the one below. Althought this one uses Flash and Microsoft's Media Player. I've seen the examples on Adobe.com of the playlist driven. http://www.adobe.com/devnet/flash/articles/prog_download.html I don't want
a scrolling combobox. I want to populate video thumbnails and text just like they do in this example below.
http://www.foodnetwork.com/food/video_guide/
QUESTIONS:
1) What do you do in ActionScript to get a video to play when you click on a thmubnail?
2) Does the thumbnail and the FLV player all have to be in the same SWF file?
3) Does anyone know of any pre-built package that looks a lot like the above food network video player?
I searched the net and Adobe and haven't found as a slick a player yet.
Thanks
Dan
Need Advice On XML Driven Video Player With Dynamic List..plz
Hello Everyone,
I am scripting a video player and one of its functionalities is to be able to have a playlist that can be arranged by the user in any order user like. For Example, if there are lets say 5 videos within the playlist:
SONG 1
SONG 2
SONG 3
SONG 4
SONG 5
User can then change the order of the videos by clicking on any video and dragging it up or down just like windows mediaplayer and the player should play the videos in such order.
So far, I have been able to use the list component but am not sure if it will allow the dragging.
I would highly appreciate it if you guys can suggest what should I do to handle this functionality.
Thanks a lot.
Flash Video Player Doesn't Show Up In Programs List.
I have successfully installed Flash Video Player (the latest version) on two different computers, but I cannot find the executable to open the player. I have more than one FLV player on my computer. I should be able to right-click on the video file, select "open with..." and select Adobe Flash as the player, however, it does not show up anywhere on the programs list - why is this?
Attached Standard Video Controls To External Video
I have loaded a video using NetStream/Net Connection, etc. I am able to control it by creating my own buttons, but I'd like to just attached the standard FLV Playback components. Is there a way for me to do that?
External List With Hyperlinks?
I need to create a simple text list where each item will have a hyperlink. But I want the list to be able to be edited from an external file. I have imported simple text files in to Flash text fields but I don't know where to begin when adding hyperlinks to those text items.
I have heard that maybe XML will need to be used but I don't know anything about XML. Can anyone simplify this for me?
Bulleted List Using External Css
Hello,
How do i create a bulleted list in dynamic field using external css?
I tried the code below with no effect...
xbullet {
color: #0033FF;
list-style: outside; //OR list-style-image: url(bullet.jpg);
}
Currently I use this code successfully to format my textfields.
content4 {
color: #ff0000;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 36px;
font-weight: bold;
textDecoration: underline;
display: inline;
}
Thank You
[b] Help Populating Combo Box List From And External Xml Doc[/b]
Hi
I've got a mp3 player that ive made with the song sources coded right into the player its self. I want to be able to populate the dropdownlist from and external xml doc. Can anyone help me with the code for that my xml name is musicmenu.xml and my combo box name is playlist_cb Thanks alot I appreciate it. I've only been working with flash for 4 weeks now so really new to this.
External Data And Unordered List
hey people
I have two scenarios:
ActionScript Code:
bla.htmlText = "<li>one</li><li>two</li><li>three</li><li>four</li>This is now a new paragraph";
This outputs:
ActionScript Code:
one
two
three
four
This is now a new paragraph
Perfect!
Now the second scenario:
I get text from the database.
ActionScript Code:
<li>One</li><li>Two</li><li>Three</li>
When I write that into a dynamic textfield, there are massive spaces between the lines:
ActionScript Code:
one
two
three
Can anyone shed light why this happens and how I can eliminate it? My textfield is linked to a CSS stylesheet - can I add some class info to the CSS to fix it?
Any input would be appreciated.
Tali ho
Creating A List From External Swf Files
On my main flash file I have loaded in external swf files using the code
on (release) {
_root.blank_mc.loadMovie("random.swf");
}
that is working fine, what I am now trying to do is load another external swf when a button is pressed and have it load underneath the first swf file to form a list...I guess it would function like a shopping list made of external swf files.
does anyone know what code i would use to have the second swf register that there is a first swf in place and so sit underneath the first one?
if that makes any sense?
Create Automated List With External .txt
I searched and couldnt find the answer to this problem so forgive me if it has been posted before. I have created an automated list:
ActionScript Code:
var buttonNames:Array = ["name1", "name2", "name3"];
dropDownList_mc.item_mc._visible = false;
function populateList () {
var spacing:Number = dropDownList_mc.item_mc._height + 2;
var numberOfButtons:Number = buttonNames.length;
var i:Number = -1;
while (++i < numberOfButtons) {
var name:String = "item" + i;
dropDownList_mc.item_mc.duplicateMovieClip (name, i);
dropDownList_mc[name].itemName_txt.text = buttonNames[i];
dropDownList_mc[name]._x = 0;
dropDownList_mc[name]._y = i * spacing;
dropDownList_mc[name].pictureID = i + 1;
dropDownList_mc[name].list_btn.onRelease = function () {
itemClicked (this._parent.pictureID);
};
}
}
dropDownList_mc.menu_btn.onRelease = function () {
populateList ();
};
The list generates perfectly with the names I have manualy entered here:
ActionScript Code:
var buttonNames:Array = ["name1", "name2", "name3"];
The problem is I want to load the names dynamically through a .txt file. I know how to pull in the .txt file, and I am doing that with this script:
ActionScript Code:
var externalData:LoadVars = new LoadVars();
externalData.onLoad = function(){
owed_txt.text = externalData.hurricane;
}
externalData.load("names.txt");
I cant get the list I pull in to load in the automated list I created. Please help me, I am stuck. Thanks!
Yet Another Preload External Swf Question To Add To The List
hi, heres my description.
frame 37 i have a blank mc called instance "m_name" and this code on the mc.
ActionScript Code:
onClipEvent (enterFrame) { if (!loaded && this._url != _root._url) { if (this.getBytesLoaded() == this.getBytesTotal()) { loaded = true; gotoAndStop(38); } }}
and then on frame 38 the "m_name" mc is still there, and i have this code on a new layer.
ActionScript Code:
m_name.loadMovie("home.swf");stop();
but it's not working. when i test it on the internet, frame 37 doesnt stop to load, it just goes straight to 38, where the "home.swf" file takes a while before it shows, as it hasnt loaded yet! :/
can anyone help?
thanks.
List Of External Images Into An Array
hi there,
I am trying to get a list of image files into an array and am having problems, here is the contents of the text file:
&images="image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg"
I want to get them to display in an array like this:
this.pArray = ["image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg"];
i am assuming i will have to use load variables but i don't know how.
Cheers,
Bob
www.bobcooper.org.uk
info@bobcooper.org.uk
07840 978569
Dynamic List From External File
hello all,
i just want some key words to make one dynamic table list, example (shopping list with products) where i can click one by one products where after click i choose what action i want to make (more info, some popup window, ...) but i don't know what way i need to go.
other thing is, i create dynamic stuff with duplicateMovieClip() and setProperty () functions, but and if with that i get one big list with 100 products? how i create one scroll (dynamic scroll offcource) for that?
note:
i get all the list and products from external file like : VAR=some description, just to use with php and data base (mysql).
well, its all for now....
Yet Another Preload External Swf Question To Add To The List
hi, heres my description.
frame 37 i have a blank mc called instance "m_name" and this code on the mc.
ActionScript Code:
onClipEvent (enterFrame) { if (!loaded && this._url != _root._url) { if (this.getBytesLoaded() == this.getBytesTotal()) { loaded = true; gotoAndStop(38); } }}
and then on frame 38 the "m_name" mc is still there, and i have this code on a new layer.
ActionScript Code:
m_name.loadMovie("home.swf");stop();
but it's not working. when i test it on the internet, frame 37 doesnt stop to load, it just goes straight to 38, where the "home.swf" file takes a while before it shows, as it hasnt loaded yet! :/
can anyone help?
thanks.
Loading External Swf Files From A List Box?
Hi all,
This is my first post here on the gotoandlearn forums. I've been watching lee's tutorials for awhile now and thought it was about time to join up over here.
The xml tutorial lee put together was really great (thanks by the way)! I'm trying to port over a project I've built in as2 that works similar to a powerpoint presentation. In my project, I have a listbox that populates individual swf files that are loaded onto the main stage when selected.
After watching the tutorial, I understand how the xml stuff works, but I'm lost as to how to load these external files from the box onto the main stage.
My question is this -- what is the best way to load external swf files from a list box that is pulled in via xml?
Heres how my xml looks:
Code:
<module>
<slide>
<file>"swf/SplashPage.swf"</file>
<description>Splash Page</description>
</slide>
<slide>
<file>"swf/Intro.swf"</file>
<description>Intro</description>
</slide>
</module>
Thanks for any help, I look forward to posting some more stuff on here soon! Any resources/feedback/comments here would be greatly appreciated.
Updating Textbox From External Movie List
I have a placeholder movie clip which loads external swf files from a folder on my server called "mymovies".
I would like to have a text box that lists the names of the movies that are in my "mymovies" folder.
I would, periodically change the movies that are in my "mymovies" folder and would like the text box to automatically update itself.
anyone know how?
oh and is it also possible to skew a dynamic text box and have it still function?
thx
Populating A List Component From An External .txt File
I need to pull a list of presenters from a .txt file and populate a list component. Here's the code I'm working on, but it's doing nothing:
stop();
loadVariables ("presenters.txt", this);
var n = totalPres;
var i = 1;
// the total nnumber of presenters
presentersListArray = new Array();
while (i < n) {
presentersListArray.push({data:"pres"+n, label:"pres"+n});
// pres+n should equal "pres1", "pres2", etc.
i++;
}
presenters.dataProvider = presentersListArray;
Any help is appreciated. Thanks.
Bulleted List In Dynamic Field Using External Css
Hello,
How do i creaet a bulleted list in dynamic field using external css?
Currently I use this code successfully to format my textfields.
I tried the code below with no effect...
xbullet {
color: #0033FF;
list-style: outside; //OR list-style-image: url(bullet.jpg);
}
content4 {
color: #ff0000;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 36px;
font-weight: bold;
textDecoration: underline;
display: inline;
}
Thank You
Import Multiple Swf Files From External List
Ok, I'm pretty new to actionscript. I can't seem to find help on what I need to do by searching in Google. Perhaps I'm using the wrong keywords in my search?
I need to load multiple .swf files into a master .swf file. Sounds easy, just use the loadMovie function right?
Here's the hard part, I need to import a .txt or .xml file which specifies what movies to load and what order they load in.
After an imported swf has played to the end of its timeline, the main master .swf would look to the .txt or .xml file to see what files comes next.
Any help with this would be great or at least a point in the right direction.
Thanks.
External Load ALL Fies In A Folder (no List)
Hi,
I am having this folder (samples) having many SWF files inside it that I would like to load externally from main.swf. Those SWF files will not always be the same, some might get added, some deleted OUTSIDE main.swf
main.swf -|- ..
|- samples
I have 2 questions:
1) How can I build a list of all file names in folder 'samples'? I am not aware of a Flash function that can scan a folder and return existing file names inside.
2) Is it possible to have movies with transparency when loaded externally? Because I don't know how to create a Flash movie with no background (equivalent to Photoshop's New/Transparent background)
I am counting on your help. Thanks.
To Call To An External Film From A Component List
Hello how they are, I hope pudan to help to me with the following thing: In a component list I want that when pressing on each item me carge an external film within MC an emptiness which I will use like container, the truth is first you see that use the comoponente list and wanted that they will help me just a little bit, to put the items uses the following code:
Code:
lista.addItem({data:'flash', label:'Flash MX 2004'});
lista.addItem({data:'flashpro', label:'Flash 8'});
lista.addItem({data:'coldfusion', label:'ColdFusion MX'});
Here I can deduce that it dates is the variable and label is what will appear in the list, but of I do not know here what to more make so that when tightening for example 2004 Flash MX me carge a film in my MC emptiness. If it could say to me how much would be thanked for
Need List Scroller To Trace External Movie Variable.
Hey all,
I need my list(which is now an image scroller), in a parent swf, to trace the variable value that is being called in playSound(), in the external swf. All I get is undefined.
Currently, the list populates with an image as the variable iterator changes(about 13 changes = 13 images in the list scroller).
Below is the code from my external swf:
ActionScript Code:
var soundArray:Array = new Array(snd1, snd2, snd3, snd4, snd5, snd6, snd7, snd8, snd9, snd10, snd11, snd12, snd13);
function playSound():Void
{
soundArray[iterator-1].start();
soundArray[iterator-1].onSoundComplete = fadeOut;
_isComplete();
}
Below is the code for my parent swf(with the list scroller):
ActionScript Code:
//---------------ICON SCROLLER CODE--------------------
IconScrollerMain_mc.IconScroller_mc.scroller_lst.backgroundColor = 0x666666;
IconScrollerMain_mc.IconScroller_mc.scroller_lst.rowHeight = 63;
IconScrollerMain_mc.IconScroller_mc.scroller_lst.iconField = "icon";
function loadScroller(imageNum)
{
currentPage_txt.text = imageNum;
IconScrollerMain_mc.IconScroller_mc.scroller_lst.addItem({data:"image"+imageNum+".jpg", icon:"image"+imageNum, label:imageNum});
progressBar_mc.greenBar_mc._yscale = (imageNum/totalPage_txt.text)*100;
progress_txt.text = Math.round((imageNum/totalPage_txt.text)*100)+"%";
}
IconScrollerMain_mc.IconScroller_mc.menu_mc.onRelease = function()
{
if (this._parent._parent._currentframe==1)
{
this._parent._parent.gotoAndPlay(2);
}
else
{
this._parent._parent.gotoAndPlay(16)
};
};
var listObt:Object = new Object();
listObt.change = function()
{
soundControl();
}
IconScrollerMain_mc.IconScroller_mc.scroller_lst.addEventListener("change", listObt);
function soundControl()
{
trace(empty_mc.playSound().soundArray);
}
//////////////////////////////////////////////////////
I cannot trace anything but undefined when I select any of the images in the list scroller.
Any help would be greatly appreciated!
Slide Show Loading From External List Of Jpegs
I know there are a few posts along similar lines, but it seem the links and such on these posts have all vanished or expired And the components are all so skinned that its almost impossible to use them.
Basically having not had much developing to do in Flash for quite a while, I've come back to realise that I'm almost clueless, and the little knowledge I still have is a dangerous thing as it keeps sending me down the wrong road.
What I want is an variable number of jpegs in a number of differant folders to load when the relevant variable is called. I would like it if possible to go to the relevant folder and read the number of images in that folder either via txt file or more modern method, then display the first image (01.jpg) then after a few seconds move on to the second image (02.jpg) etc
Ideally it would load the second image before moving onto the next image and fades etc would be much better, but at this point I'd just settle for the bare bones of something I can work with, and get my head around.
this might be a lot to ask, so if anyone can help it would be most appreciated.
Need List Scroller To Trace External Movie Variable.
Hey all,
I need my list(which is now an image scroller), in a parent swf, to trace the variable value that is being called in playSound(), in the external swf. All I get is undefined.
Currently, the list populates with an image as the variable iterator changes(about 13 changes = 13 images in the list scroller).
Below is the code from my external swf:
ActionScript Code:
var soundArray:Array = new Array(snd1, snd2, snd3, snd4, snd5, snd6, snd7, snd8, snd9, snd10, snd11, snd12, snd13);
function playSound():Void
{
soundArray[iterator-1].start();
soundArray[iterator-1].onSoundComplete = fadeOut;
_isComplete();
}
Below is the code for my parent swf(with the list scroller):
ActionScript Code:
//---------------ICON SCROLLER CODE--------------------
IconScrollerMain_mc.IconScroller_mc.scroller_lst.backgroundColor = 0x666666;
IconScrollerMain_mc.IconScroller_mc.scroller_lst.rowHeight = 63;
IconScrollerMain_mc.IconScroller_mc.scroller_lst.iconField = "icon";
function loadScroller(imageNum)
{
currentPage_txt.text = imageNum;
IconScrollerMain_mc.IconScroller_mc.scroller_lst.addItem({data:"image"+imageNum+".jpg", icon:"image"+imageNum, label:imageNum});
progressBar_mc.greenBar_mc._yscale = (imageNum/totalPage_txt.text)*100;
progress_txt.text = Math.round((imageNum/totalPage_txt.text)*100)+"%";
}
IconScrollerMain_mc.IconScroller_mc.menu_mc.onRelease = function()
{
if (this._parent._parent._currentframe==1)
{
this._parent._parent.gotoAndPlay(2);
}
else
{
this._parent._parent.gotoAndPlay(16)
};
};
var listObt:Object = new Object();
listObt.change = function()
{
soundControl();
}
IconScrollerMain_mc.IconScroller_mc.scroller_lst.addEventListener("change", listObt);
function soundControl()
{
trace(empty_mc.playSound().soundArray);
}
//////////////////////////////////////////////////////
I cannot trace anything but undefined when I select any of the images in the list scroller.
Any help would be greatly appreciated!
Load Xml Data(list Of Names), Use List As Buttons In Flash Possible?
Hi, basically I have a quiz game that I made, the quiz is done but I want to keep track of how many times a person has failed the quiz. I have an XML file that has a list of names. I want to take those names, put them in a quiz game (at the beginning) as a "list" of some sort and let the user be able to choose their own name (which is of course already in the XML file). This name will be used to keep track of how many times they have tried the quiz.
I have successfully loaded the XML file (names) into an ARRAY in Flash but how can I output them to the screen AND let the user be able to choose those from the list? as a button? This will add the count after they clicked their name to +1 and then save it to somewhere(where is best?). I will attach the zipped files (there are 4, the fla,swf,2 XML files[quiz/names]). If anyone can help me ASAP it would be awesome.
|