XML

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentXML

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old November 25th, 2005, 02:15 PM
victord_21 victord_21 is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 1 victord_21 New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 3 m 44 sec
Reputation Power: 0
Please HELP with an XML gallery code

Hi. I need some help on a XML gallery code...The code is kindda' finished...well, kindda...The gallery is set to load like this:



It reads the XML to store the number of thumbnails that I want to group in 3 rows and stacks of 6 (subgalleries-movieclip from the library)...so I calculate the number of subgalleries.



Then I load the thumbnails in different instances of a movieclip from the library which I want to place in the subgallery using a function with attachMovie and if...else with different conditions.



The problem is that I can't get the attachMovie sintax right on function thumbnails_fn...It doesn't attach the movieclips from the library if I want to attach them to the subgallery...it works if I load them to the scene... I can't figure out what I'm doing wrong.



Here's the code that I use:



function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
thumbnails = [];
albume = [];
total = xmlNode.childNodes.length;
if(total%6==0){
_root.r=Math.round(total/6);
}else{
_root.r=Math.round((total/6)+1);
}
for(j=0; j<_root.r; j++){
albums(j);
}
a1=0;
for (a2=0; a2<_root.r; a2++) {
CA=albume[a2];
trace(CA);
for (i=a1; i<a1+6; i++) {
if(i<total){
thumbnails[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
thumbnails_fn(i,CA);
}
}
a1+=6;
}
}else {
content = "file not loaded!";
}


}

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("projects.xml");



/////////////////////Thumbnail Generator Code//////////////


function thumbnails_fn(k,CAlbum){
movie=this.CAlbum.attachMovie("obj", "obj"+k, 500+k);
if(k>0){
if((k)%3==0){
movie._x=0;
movie._y += thisY+80;
}else{
movie._x += thisX+120;
movie._y = thisY;
}
}else{
movie._x=0;
movie._y=0;
}
thisX=movie._x;
thisY=movie._y;
movie.thumbnail.loadMovie(thumbnails[k],movie.thumbnail.getNextHighestDepth());
}


/////////////////Album Generator Code//////////////


function albums(h){
albumMC=this.attachMovie("album", "album"+h, 50+h);
albume[h]= "album"+h;
albumMC._x=0;
albumMC._y += thisYalbum+200;
thisYalbum=albumMC._y;
}



Really appreciate any help I can get!

Reply With Quote
  #2  
Old December 27th, 2005, 07:47 AM
Sergiu_spooky Sergiu_spooky is offline
Contributing User
Tutorialized Novice (500 - 999 posts)
 
Join Date: Dec 2005
Location: Romania
Posts: 642 Sergiu_spooky New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 2 m 29 sec
Reputation Power: 0
Send a message via MSN to Sergiu_spooky Send a message via Yahoo to Sergiu_spooky
hmmm

is "movie" on _root ?

try using _root.movie

maybe it will do the trick...

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentXML > Please HELP with an XML gallery code


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap