Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

XML menu tree

This is a discussion on XML menu tree within the advanced Actionscript 3.0 forums, part of the Flash CS3 eng category; I forgot to mention I use TweenLite & TweenMax for ths fade etc effects. have a nice day!...


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
  #41 (permalink)  
Old 08-07-08, 04:52
Flash Addict
 
Join Date: Jan 2008
Location: Greece
Posts: 6
Rep Power: 0
michako is on a distinguished road
Re: XML menu tree

I forgot to mention I use TweenLite & TweenMax for ths fade etc effects.

have a nice day!
__________________
"έν οίδα οτι ουδέν οίδα" - Σωκράτης
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #42 (permalink)  
Old 29-07-08, 19:35
Junior Member
 
Join Date: Jul 2008
Posts: 1
Rep Power: 0
karikkik is on a distinguished road
Re: XML menu tree

Thanks for your source files, Michako! It really helps me out :]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #43 (permalink)  
Old 14-08-08, 16:45
Junior Member
 
Join Date: Aug 2008
Posts: 1
Rep Power: 0
aclub is on a distinguished road
Re: XML menu tree

Looks great michako. So how do we link urls to each of the drop down menu items in the xml?

thanks all!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #44 (permalink)  
Old 19-08-08, 16:57
Flash Addict
 
Join Date: Jan 2008
Location: Greece
Posts: 6
Rep Power: 0
michako is on a distinguished road
Re: XML menu tree

Hi!
well that's pretty easy.
first specify the urls at the xml (data/xmlMenu.xml)

mine finished was like this

Code:
<?xml version="1.0" encoding="utf-8" ?> 
<projects>
  <TC NAME="//Large">
    <CT name="ATH" url="http://www.michako.com"></CT> 
    <CT name="MHG" url="http://www.mywetcalvin.com" ></CT>
    <CT name="SDF" url="http://www.skolix.gr/beta"></CT>
    <CT name="JYT" url="http://www.flepstudio.org"></CT>
  </TC>
  <TC NAME="//Medium">
    <CT name="MEL" url="http://www.michako.com"></CT> 
  </TC>
  <TC NAME="//Small">
    <CT name="MRN" url="http://www.michako.com"></CT> 
    <CT name="BOX" url="http://www.michako.com"></CT> 
    <CT name="ALX" url="http://www.michako.com"></CT>
  
</TC>
</projects>
and then to call each url when you hit the buttons
at the CLICK function, which in this case its ctClick
you call the corresponding url by tracing which button was pressed by the event targets name.

line 190

Code:
//click the subcat. - do whatever you want here
        private function ctClick(event:MouseEvent):void
        {
            for each (var xmlInfo:XML in xmlData.TC.CT)
            {
                if(xmlInfo.attribute("name") == event.target.name)
                {
                    var url_str:String = xmlInfo.attribute("url");
                    if (ExternalInterface.available)
                    {
                        ExternalInterface.call( "window.open", url_str, "_blank" );
                    } else
                    {
                        var urlRequest:URLRequest = new URLRequest(url_str);
                        navigateToURL(urlRequest,"_blank");
                    }
                }
            }
        }
of course you have to import the needed classes
at the beginning

Code:
//new imports needed for the url call
    import flash.net.URLRequest;
    import flash.external.ExternalInterface;
    import flash.net.navigateToURL;
if you want a preview go here xmlMenuExample
and if you want the source here
http://www.michako.com/xmlMenu/XMLMenu+url.rar

cya
__________________
"έν οίδα οτι ουδέν οίδα" - Σωκράτης
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
Load directory structure in tree component fisad Flash CS3 eng 0 17-04-08 23:08
menu tree ad albero in su sk8benji Flash CS3 generale 2 01-04-08 13:45
[propagazione di eventi] menu tree pepigno75 Actionscript 3.0 avanzato 2 24-03-08 14:42


All times are GMT. The time now is 21:31.


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