Is there a way to create a XML video Playlist that does not use the list box component?
I have done a search on the net and all the tutorials I have seen use the component.
Thanks
Ponayck
Printable View
Is there a way to create a XML video Playlist that does not use the list box component?
I have done a search on the net and all the tutorials I have seen use the component.
Thanks
Ponayck
not sure where yoru coming from..and where you are now...
but you can use whatever you like.
(is a 'listBox; the same a 'comboBox')?
but I'm assuming the user needs to 'interact' with this list? to choose the video he/she wants to view?
How do you want this controlled then? You can create a 'template' movieClip that looks like a button, with a synamic textField...and as many 'entries' that are in the XML doc...you can attach a button to the stage..and populate the dynamic textField with the videoClips name form the XML doc....
and do whatever it is you have to do.
Hi
Its the "list" located in the components, sorry about that confusion.
I am using the AS codeand that seems to have solved most of my design issues except for the loo of the scroll bars... I have seen a couple of tutorials about "skinning" the components but have not really tackled that aspect, yet...Quote:
setStyle
Your suggestion for the MC "template" is what I would like to do...I know how to create the button that you are talking...this is the code that i am using with the list component...
how do I rewrite this using the "template" MC that you suggestedQuote:
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);
Thanks
you would use attchMovie
this example has 3 options..a component button, and custom template clip, and the comboBox component..
what I did was put a comboBox component on the stage (called: videoCombo)
and in the library I had TWO objects:
1.) a regular component button
2.) a movieClip, that is nothing more than a outline (like a rectangle button) and a dynamic textField... textField name: buttonField. I also set the linkage property for this movieClip to be: buttonTemplate...and the NEW instance name to be given when attached: tempButton (+[i])
here is the code:
and here is the .fla:Code:import mx.utils.Delegate;
var rootNode:XMLNode;
var videosNode:Array;
var totalVideos:Number;
var myVideos_xml = new XML();
myVideos_xml.ignoreWhite = true;
myVideos_xml.onLoad = Delegate.create(this, getTotalVideos);
myVideos_xml.load("videoXML.xml"); //local version
//
function getTotalVideos(success):Void {
trace("Get Total Vids");
if (success == true) {
trace("Load OK");
rootNode = myVideos_xml.firstChild;
videosNode = rootNode.childNodes;
totalVideos = videosNode.length;
placeButtons();
this.onEnterFrame = Delegate.create(this, function() {
populateComponents();
delete this.onEnterFrame;
}//end Function
); //end Delegate
}else {
trace("Load Failed");
}
}
//
function placeButtons():Void {
trace("Place buttons");
//Define how many columns
var columns:Number = 1;
//Define the item vSpacing;
var vSpacing:Number = 10;
//Define the item hSpacing;
var hSpacing:Number = 0;
for (i=0; i<totalVideos - 1; i++) {
//template buttons
var attachProduct:MovieClip = attachMovie("buttonTemplate", "tempButton"+i, this.getNextHighestDepth());
attachProduct._x += 10;
attachProduct._x += i * 125;
attachProduct._y += 20;
//attachProduct._y += i * 45;
//attachProduct._y = Math.floor(i / columns) * hSpacing; //only used with multiple columns
//attachProduct._x = Math.floor(i % columns) * vSpacing; //only used with multiple columns
//component buttons
var attachProduct2:MovieClip = attachMovie("Button", "compButton"+i, this.getNextHighestDepth());
attachProduct2._x += 10;
attachProduct2._x += i * 125;
attachProduct2._y += 50;
}
}
//populate
function populateComponents():Void {
trace("Populate Components");
for (j = 0; j < totalVideos-1; j++) {
//buttonTemplate data
var videoName:String = videosNode[j].firstChild.nodeValue;
var obj = this["tempButton" + j];
obj.buttonField.text = videoName;
//componentButton data
var videoName:String = videosNode[j].firstChild.nodeValue;
var obj = this["compButton" + j];
obj.label = videoName;
//comboBox data
var videoName:String = videosNode[j].firstChild.nodeValue;
trace("Video name: "+videoName);
_root.videoCombo.addItem(videoName);
}
}
www.dmstudios.net/xml_attachClip.zip
I also have a link in my footer about attachMovie...but it uses a text loadVar Object..this one has the XML object you used..
Thanks for the files, i'll let you know how things go
I'm trying to do the same thing as Ponyack but have ALOT less xml experience so I thought going to the link posted by Whispers might help. Unfortunately the link is not working. Would you mind reposting please?
Thanks whispers!