Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Multiple Gallery XML Slideshow

This is a discussion on Multiple Gallery XML Slideshow within the advanced Actionscript 3.0 forums, part of the Flash CS3 eng category; Hi Flep, Thank You again for providing such valuable learning tools for everyone here. It seems everyday you're posting ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng > advanced Actionscript 3.0

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 21-08-07, 09:02
Junior Member
 
Join Date: Jan 1970
Posts: 2
Rep Power: 0
Marco is on a distinguished road
Multiple Gallery XML Slideshow

Hi Flep,

Thank You again for providing such valuable learning tools for everyone here. It seems everyday you're posting something even cooler than the day before, and I love it. So far learning Actionscript 3.0 has been challenging, and especially frustrating because I actually know Actionscript 2.0 pretty well. Anyway, I wondering how I would be able to load your Full Screen XML slideshow with multiple album categories. I know all the data for each album can be stored in a single xml. I'm just unclear how I would parse the xml data, and then ultimately connect the different galleries to a single menu.

Thanks,
Marco
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 21-08-07, 09:42
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Hi Marco,
i'm glad you like my articles :)

I will work on multi categories and i think the 2.0 version of fullscreen gallery will allow them.
Anyway, if you'd like to try, you should work with double-dimension Arrays and this kind of XML:
HTML Code:
<?xml version="1.0" encoding="UTF-8"?>
<gallery>
    <category1 name='diary'>
        <image>diary/pic_0.jpg</image>
        <image>diary/pic_1.jpg</image>
        <image>diary/pic_2.jpg</image>
    </category1>
    <category2 name='wedding'>
        <image>wedding/pic_0.jpg</image>
        <image>wedding/pic_1.jpg</image>
        <image>wedding/pic_2.jpg</image>
        <image>wedding/pic_3.jpg</image>
        <image>wedding/pic_4.jpg</image>
        <image>wedding/pic_5.jpg</image>
    </category2>
    <category3 name='nature'>
        <image>nature/pic_0.jpg</image>
        <image>nature/pic_1.jpg</image>
        <image>nature/pic_2.jpg</image>
    </category3>
    <category4 name='people'>
        <image>people/pic_0.jpg</image>
        <image>people/pic_1.jpg</image>
        <image>people/pic_2.jpg</image>
        <image>people/pic_3.jpg</image>
    </category4>
    <category5 name='fruit'>
        <image>fruit/pic_0.jpg</image>
        <image>fruit/pic_1.jpg</image>
        <image>fruit/pic_2.jpg</image>
    </category5>
</gallery>
With this sample of Document Class, you can store each data into an Array and gets avery value:

Code:
package
{
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.events.Event;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.xml.*;
    import flash.geom.ColorTransform;
    
    public class LoadingXML extends MovieClip
    {
        private var my_array:Array;
        
        public function LoadingXML()
        {
            my_array=new Array();
            
            this.loadXML();
        }
        private function loadXML():void
        {
            var loader:URLLoader=new URLLoader();
            loader.addEventListener(Event.COMPLETE,completeHandler);
            
            var request:URLRequest=new URLRequest('gallery.xml');
            try 
            {
                loader.load(request);
            } 
            catch(error:Error) 
            {
                trace('Impossibile caricare il documento.');
            }
        }
        
        private function completeHandler(event:Event):void
        {
            var loader:URLLoader=URLLoader(event.target);
            var result:XML=new XML(loader.data);
            var myXML:XMLDocument=new XMLDocument();
            myXML.ignoreWhite=true;
            myXML.parseXML(result.toXMLString());
            var node:XMLNode=myXML.firstChild;
            var n:int=node.childNodes.length;
            var names_array:Array=new Array;
            for(var i:int=0;i<n;i++)
            {
                names_array.push(node.childNodes[i].attributes['name']);
                var pics_array:Array=new Array();
                var s:int=node.childNodes[i].childNodes.length;
                for(var j:int=0;j<s;j++)
                {
                    pics_array.push(node.childNodes[i].childNodes[j].firstChild.nodeValue);
                }
                my_array.push(pics_array);
            }
            my_array.push(names_array);
            
            // first index container[] = categories name and second index conteiner[] = picture of the category you called with the first index
            // so for example, the next line will get the ' people ' category ( index 3 of my_array ) and the 3rd picture ( pic_2.jpg ) ----- you can easy browse your array 
            trace(my_array[3][2]);
        }
    }
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 22-08-07, 01:51
Junior Member
 
Join Date: Jan 1970
Posts: 2
Rep Power: 0
Marco is on a distinguished road
Thanks Flep
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 24-08-07, 16:47
Junior Member
 
Join Date: Aug 2007
Location: Dallas
Posts: 10
Rep Power: 0
mdwatkins is on a distinguished road
Dittos

Outstanding resource! The company has been forced to switch from Authorware to Flash so I have to dive into a totally different authoring environment - your effort and time is greatly appreciated.

Mark

Quote:
Originally Posted by Marco View Post
Hi Flep,

Thank You again for providing such valuable learning tools for everyone here. It seems everyday you're posting something even cooler than the day before, and I love it. So far learning Actionscript 3.0 has been challenging, and especially frustrating because I actually know Actionscript 2.0 pretty well. Anyway, I wondering how I would be able to load your Full Screen XML slideshow with multiple album categories. I know all the data for each album can be stored in a single xml. I'm just unclear how I would parse the xml data, and then ultimately connect the different galleries to a single menu.

Thanks,
Marco
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #5 (permalink)  
Old 26-12-07, 16:28
Junior Member
 
Join Date: Dec 2007
Posts: 1
Rep Power: 0
micro_vn is on a distinguished road
Re: Multiple Gallery XML Slideshow

thanks . chúng mày ngu lắm :D
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Flash Multi Gallery
  #6 (permalink)  
Old 10-06-08, 15:23
Junior Member
 
Join Date: Jun 2008
Posts: 1
Rep Power: 0
damnkreative is on a distinguished road
Re: Multiple Gallery XML Slideshow

can you provide the source file....??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #7 (permalink)  
Old 14-06-08, 10:55
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: Multiple Gallery XML Slideshow

Sorry I have not source files, I wrote the code in that moment.
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Pixellation - SlideShow Flep FlepStudio utilities 9 25-11-08 14:34
Multiple Choice mdwatkins Components 16 11-10-08 00:56
Need help on this slideshow rexus Actionscript 3.0 newbies 3 01-02-08 08:10
Slideshow Sergio_2008 Flash CS3 generale 1 28-01-08 07:33
Random Image Slideshow(in AS 2.0) lex_ph Actionscript 3.0 newbies 3 03-01-08 01:07


All times are GMT. The time now is 22:27.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406