Go Back   Dynamic Drive Forums > General Coding > Flash
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 01-29-2007, 05:15 AM
sundeep_02tv26 sundeep_02tv26 is offline
Junior Coders
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Red face xml photo gallery in flash mx 2004

hai to all plz help me

i want to know about xml photo gallery. i tried but i couldnot understand.

i have two pics and description for it in xml--its is fine

i used attributes for filename url and desc.

i had loaded one pic in the temp movieclip in flash but i couldnot load another pic in another movieclip. plz help me
Reply With Quote
  #2  
Old 01-29-2007, 05:22 AM
BLiZZaRD's Avatar
BLiZZaRD BLiZZaRD is offline
Elite Coders
 
Join Date: Aug 2005
Location: Other Side of My Monitor
Posts: 3,158
Thanks: 1
Thanked 62 Times in 62 Posts
Default

It would help if you posted the code you are using. Also you only need one topic per question. Starting multiple threads about the same thing is frowned upon in most communities, including this one.

Post your code here and we will go from there.
Reply With Quote
  #3  
Old 01-29-2007, 11:17 AM
sundeep_02tv26 sundeep_02tv26 is offline
Junior Coders
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am sorry for it

i tried with two files

first files :-
var main:Array = new Array();
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
//portfolioTag = this.firstChild;
var numimages = this.firstChild.childNodes.length;
trace(numimages);
vspacing = 100;
for (i=0; i<numimages; i++) {
this.holder_mc = this.firstChild.childNodes[i];
this.thumb_mc = thumb_mc.createEmptyMovieClip("thumb_mc"+i, i);
this.thumb_mc._y = i*vspacing;
this.thumbLoader = this.thumb_mc.createEmptyMovieClip("thumb_mc"+i, 0);
this.thumbLoader.loadMovie(this.holder_mc.attributes.thmb);
_root.desc_txt.text = this.holder_mc.attributes.desc;
trace(_root.desc_txt.text);
this.thumb_mc.main[i] = this.holder_mc.attributes.pics;
trace(this.thumb_mc.main[i]);
this.thumb_mc.onPress = function() {
holder_mc.loadMovie(this.main);
desc_txt.text = this.desc;
};
}
};
myPhoto.load("cont.xml");

second file:
var thmpics:Array = new Array();
var mainpics:Array = new Array();
var desc:Array = new Array();
var xl:XML = new XML();
xl.load("cont.xml");
xl.ignoreWhite = true;
xl.onLoad = function(ok) {
if (ok) {
total = xl.firstChild.childNodes.length;
for (i=0; i<total; i++) {
thmpics[i] = xl.firstChild.childNodes[i].attributes.thmb;
trace(thmpics[i]);
mainpics[i] = xl.firstChild.childNodes[i].attributes.pics;
trace(mainpics[i]);
desc[i] = xl.firstChild.childNodes[i].attributes.desc;
trace(desc[i]);
_root.thumb_mc.createEmptyMovieClip("thumb_mc"+i, i);
thmpics[i];
"thumb_mc"+i.loadMovie(thmpics[i]);
trace("loded");
//_root.thumb_mc.loadMovie(thmpics[i]);
//thumb_mc._x = thumb_mc._x*10;
thumb_mc.onPress = function() {
_root.holder_mc.loadMovie(mainpics[i]);
_root.desc_txt.text = desc[i];
};
}
} else {
trace("XML not loaded");
}
};
Reply With Quote
  #4  
Old 01-29-2007, 02:08 PM
BLiZZaRD's Avatar
BLiZZaRD BLiZZaRD is offline
Elite Coders
 
Join Date: Aug 2005
Location: Other Side of My Monitor
Posts: 3,158
Thanks: 1
Thanked 62 Times in 62 Posts
Default

The first one looks fine.. unless I am missing something. What does your XML look like?

Here is a working AS file for loading thumbnails and photos into the file:

Code:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load("xmlphoto.xml");
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 70;
for (i=0; i<numimages; i++) {
picHolder = this.firstChild.childNodes[i];
this.thumbHolder = _root.thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*spacing;
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;

this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image"+i, i);
this.thumbLoader.loadMovie(picHolder.attributes.thmb);


thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
};
}
};
Take a look and see if you are missing anything...
Reply With Quote
  #5  
Old 01-31-2007, 09:05 AM
sundeep_02tv26 sundeep_02tv26 is offline
Junior Coders
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Red face xml gallery plz

hai to all
here thumbs r loaded dynamic but what i want is when i click on them the main pics should be loaded in holder_mc. and on rollover they should be alpha=100% plz correct them and send plzzzzzzzzzzz

i am enable to upload file how to upload here?
Reply With Quote
  #6  
Old 01-31-2007, 01:52 PM
BLiZZaRD's Avatar
BLiZZaRD BLiZZaRD is offline
Elite Coders
 
Join Date: Aug 2005
Location: Other Side of My Monitor
Posts: 3,158
Thanks: 1
Thanked 62 Times in 62 Posts
Default

Make sure you go to "Advanced" Reply. Then under the text box is the "manage attachments" option.

The allowed file types are listed there along with the "browse" to find it locally.

Alternately you can upload it to your server and link to it in a post.
Reply With Quote
  #7  
Old 02-01-2007, 09:49 AM
sundeep_02tv26 sundeep_02tv26 is offline
Junior Coders
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

here i dont have a server to upload
Reply With Quote
  #8  
Old 02-01-2007, 02:08 PM
BLiZZaRD's Avatar
BLiZZaRD BLiZZaRD is offline
Elite Coders
 
Join Date: Aug 2005
Location: Other Side of My Monitor
Posts: 3,158
Thanks: 1
Thanked 62 Times in 62 Posts
Default

Oops... after you browse to your file, make sure you click the "upload" button as well

If it is an invalid file type (swf, fla etc) put it in a zip file first. Then upload the zip file.
Reply With Quote
  #9  
Old 02-02-2007, 11:01 AM
sundeep_02tv26 sundeep_02tv26 is offline
Junior Coders
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it's ok

i have a prob here what i did is i made a gallery its work fine.

i made a mc. in that the gallery is there. so that i can link that photogallery mc to scroll pane its worked fine.
on top of it i have a dynamic textbox where if i press on the thumbs the correspondent desc should loaded in that textbox.say how to do

i know this will confuse u becoz no source kada ok

thx for the help
Reply With Quote
  #10  
Old 02-02-2007, 04:03 PM
BLiZZaRD's Avatar
BLiZZaRD BLiZZaRD is offline
Elite Coders
 
Join Date: Aug 2005
Location: Other Side of My Monitor
Posts: 3,158
Thanks: 1
Thanked 62 Times in 62 Posts
Default

So the gallery works fine?

The text box works fine?

The loading of the full picture into the holder_MC does not work?

Is this correct?
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:18 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.