A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Pass variable from MC to _root

Threaded View

  1. #1
    Member
    Join Date
    Jul 2007
    Posts
    65

    Pass variable from MC to _root

    Hi,

    I have a movieclip that is loaded from the main timeline. Within that mc I have a button that when clicked I want to pass a variable back to a function within the main timeline.

    The below bold string is what I want to pass as a variable from the button click event in the mc to the function LoadGallery in the main timeline.

    Code:
    Defines the xml path to pass to the function
    
    function loadGallery1(){
        loadGallery("Flash/gallery1.xml");   
    }
    
    
    Calls LoadGallery function and recieves the xml path:
    
    function loadGallery(galName){
        _root.xmlDataPath = galName;  
        mcLoader.loadMovie("Flash/viewer.swf");
    }
    
    
    Calls function to run it:
    
    loadGallery1();
    All of the above code resides in the main timeline (_root), I don't show a button click event here from the mc because I don't have one. All I need that button click event to do is to populate that bold string above.

    Can anyone help me with this?

    thanks
    Last edited by frosty1_4me; 08-09-2007 at 09:57 PM.

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