A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Pass XML variable to ChildMC

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Location
    Southern California, USA
    Posts
    9

    Pass XML variable to ChildMC

    I would like to pass an imported XML value to MC's for display, but I either get an error stating the variable doesn't exist if declared XML or a conflict error if String.

    PHP Code:
    var  bookAttributes:XMLList  =  bookInput.FOLDER.attributes();
     
    for 
    each (var folderName:XML in bookAttributes) {
        var 
    mcFolder:MovieClip = new Folder();
        
    mcFolder.width 60;
        
    mcFolder.height 50;
        
    mcFolder.+= xx;
        
    mcFolder.+= yy;
        
    mcFolder.addEventListener(MouseEvent.MOUSE_OVERonTraceNamefalse0,
    true);
        
    mcFolder.addEventListener(MouseEvent.MOUSE_OUTonTraceNameOutfalse0,
    true);
        
    // here is where I  pass the value
        
    with(mcFolder){var folderName:XML;}
        
    mcFolder.folderName=folderName;
        
    //
        
    addChildAt(mcFolder2);
        
    trace(folderName);
        
    xx+=120;
        if(
    xx>900){xx=100;yy+=100;}

    PHP Code:
    // Actual error occurs here
    function onTraceName(evt:MouseEvent):void {
    evt.target.gotoAndStop(2);
    mcFolderText.text=folderName;


    http://www.061375.com
    http://www.jheminger.info Home of WaterMarker - my photo managing software project

  2. #2
    Junior Member
    Join Date
    Feb 2009
    Location
    Southern California, USA
    Posts
    9

    grr

    Ok simple solution

    PHP Code:
    //placing mcFolder after child declaration initializes folderName:XML automatically
    // Once I moved this I recieved an error od duplicate declaration

    addChildAt(mcFolder2);
    mcFolder.folderName=folderName

    http://www.061375.com
    http://www.jheminger.info Home of WaterMarker - my photo managing software project

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