rachelcjanssen
asked on
Problem Loading XML into Flash
I am using the beautiful Gallery Component developed on www.mr10.net.
I am using this version http://www.mr10.nl/components/gallery/combobox/
You can find the source files here http://www.mr10.nl/components/gallery/.
Make sure to click on the info link and scroll a bit and you will see the link.
My problem:
When I test the original gallery movie it works great and I can see the comments area at the bottom. However when I import the .swf into another flash file it loses the comments text. The thumbnail description and drop down box is still populated so I know the .xml file is being read but ...no comments.
I admittedly am not well versed in xml or actionscripting so I may be doing something wrong. Can anyone help!!!
I am using this version http://www.mr10.nl/components/gallery/combobox/
You can find the source files here http://www.mr10.nl/components/gallery/.
Make sure to click on the info link and scroll a bit and you will see the link.
My problem:
When I test the original gallery movie it works great and I can see the comments area at the bottom. However when I import the .swf into another flash file it loses the comments text. The thumbnail description and drop down box is still populated so I know the .xml file is being read but ...no comments.
I admittedly am not well versed in xml or actionscripting so I may be doing something wrong. Can anyone help!!!
I think you downloaded the wrong file. The file you described is just the flash component of the gallery itself. If you want to download the gallery demo with the combo box, you have to click on the link on the bottom of the demo at http://www.mr10.nl/components/gallery/combobox/ and download the file galleryComboboxDemo.zip.
ASKER
Maarten van de Voorde himself answered my question.
Here it is:
//parse code from xml file
function parse(success){
if(!success)
break;
var root = this.firstChild;
var n = root.childNodes.length;
var m = this._tl.menu_cb;
for (var i = 0; i < n; i++){
m.addItem(root.childNodes[ i].attribu tes.title, root.child Nodes[i].f irstChild) ;
}
m.setChangeHandler('cb_han dler', this._tl)
// --::[ 4. attach the gallery ]::-- //
g1 = this._tl.attachMovie("FGal lerySymbol ","myGalle ry",10,{_x :0, _y:0});
g1.setTnStageSide('left');
g1.setColumns(3);
g1.setTnSize(84, 84);
g1.setSize(616,300);
g1.setTnTitleStyle('title' ); // can be 'name' or 'title'
//------------------------ ---------- ---------- -----//
// --::[creating a commentfield ]::-- //
var imageText = g1.imageText;
g1.watch(
'imageText',
function(pr_op, o_txt, n_txt){
this._parent.comment_txt.t ext = n_txt;
},
this
);
//select first item from combo/listbox
m.setSelectedIndex(0);
}
The best part...it worked!
Here it is:
//parse code from xml file
function parse(success){
if(!success)
break;
var root = this.firstChild;
var n = root.childNodes.length;
var m = this._tl.menu_cb;
for (var i = 0; i < n; i++){
m.addItem(root.childNodes[
}
m.setChangeHandler('cb_han
// --::[ 4. attach the gallery ]::-- //
g1 = this._tl.attachMovie("FGal
g1.setTnStageSide('left');
g1.setColumns(3);
g1.setTnSize(84, 84);
g1.setSize(616,300);
g1.setTnTitleStyle('title'
//------------------------
// --::[creating a commentfield ]::-- //
var imageText = g1.imageText;
g1.watch(
'imageText',
function(pr_op, o_txt, n_txt){
this._parent.comment_txt.t
},
this
);
//select first item from combo/listbox
m.setSelectedIndex(0);
}
The best part...it worked!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You may have to post the relevant parts of the actionscript--the more the merrier.
Regards,
Mike Sharp