A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: XML driven menu

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Posts
    10

    XML driven menu

    Hi,

    i've been cracking my head on flash menu driven by xml. I saw a couple of example of xml driven menu that has the button to load external pages. What i would like to do is to "loadMovie" onto the stage instead of opening URL everytime the button is pressed.

  2. #2
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    here's an example.... that loads in external swf's into an empty movieclip...

    Hope this helps

    http://artofficialintel.com/download...nu_ext_swf.zip
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  3. #3
    Junior Member
    Join Date
    Jan 2007
    Posts
    10
    That's an extremely good example! Thanx mate. However i need it to place it inside a scrollpane. Do u have any suggestions?

  4. #4
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    simple give your scrollpane an instance name (such as 'my_sp') then change the target. Depending on whether you're loading directly into the scrollpane (i.e scrollpane component) or a custom scrollpane, you may have to create an empty movieclip inside the scrollpane to hold the loaded swf. then just change this line
    Code:
    item.onRelease = function() {
          holder.loadMovie(this.myUrl);
       }  
    
    // to ------->
    item.onRelease = function() {
          my_sp.loadMovie(this.myUrl);
       }
    if you want/need a custom scrollpane (for movieclips/swfs/text) i stuck a few up here http://artofficialintel.com/downloads/ that you are welcome to download/pick apart/study/use/improve on/etc just type 'scroll' in the little search window and hit return and it'll find all related files....

    hope that helps
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  5. #5
    Junior Member
    Join Date
    Jan 2007
    Posts
    10
    madzigian,

    i'm at lost for words by the help rendered... I must however burden u a bit more. How do create the empty movieclip inside the scrollpane? I tried editing the scrollpane component by dbl-clicking from the library but i can't seem to edit it. I really apologise if i am taxing you. i hv successfully change :

    item.onRelease = function() {
    my_sp.loadMovie(this.myUrl);

    I really appreciate your help....

  6. #6
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    If you are using Flash's IU ScrollPane Component... All the info you need is in Flash's HELP files. THis is from the MX04 files :

    ScrollPane.contentPath
    -----------------------------------------

    Availability

    Flash Player 6 (6.0 79.0).
    Edition
    Flash MX 2004.


    Usage

    scrollPaneInstance.contentPath


    Description

    Property; a string that indicates an absolute or relative URL of the SWF or JPEG file to load into the scroll pane. A relative path must be relative to the SWF file that loads the content.

    If you load content using a relative URL, the loaded content must be relative to the location of the SWF file that contains the scroll pane. For example, an application using a ScrollPane component that resides in the directory /scrollpane/nav/example.swf could load contents from the directory /scrollpane/content/flash/logo.swf by using the following contentPath property: "../ content/flash/logo.swf"


    Example

    The following example tells the scroll pane to display the contents of an image from the Internet:

    scrollPane.contentPath ="http://imagecache2.allposters.com/images/43/033_302.jpg";


    The following example tells the scroll pane to display the contents of a symbol from the library:

    scrollPane.contentPath ="movieClip_Name";


    The following example tells the scroll pane to display the contents of the local file logo.swf:

    scrollPane.contentPath ="logo.swf";


    ----->

    So basically... all you should have to do is substitute :
    Code:
    item.onRelease = function() {
          my_sp.loadMovie(this.myUrl);
    }
    with
    Code:
    item.onRelease = function() {
          my_sp.contentPath = this.myUrl;
    }
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center