dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] [F8] Loadmovie breaks Actionscript in SWF

  1. #1
    Member
    Join Date
    Oct 2006
    Posts
    41

    [RESOLVED] [F8] Loadmovie breaks Actionscript in SWF

    Hi everyone!

    My movie master.swf loads board.swf file 3 times. When I look at board.swf separately the actionscript etc & movie clips work fine. When board.swf is loaded into master.swf the actionscript for my object breaks(code-below) as well several buttons.

    Even when I only load one instance of board.swf into master.swf I get the same result. Non-functioning actionscript and several non-working buttons.

    Do I need to rewrite parts of my code for the board.swf or is the way I am loading the board.swf into the master.swf incorrect? Code for all to see is below.

    Code for Master.swf wich loads the board object 3 times:
    code:

    // Load board Board 1
    _root.createEmptyMovieClip("Board1",1);
    _root.Board1.loadMovie("board_object.swf");
    _root.Board1._x = 18;
    _root.Board1._y = 0;

    // Load board Board 2
    _root.createEmptyMovieClip("Board2",2);
    _root.Board2.loadMovie("board_object.swf");
    _root.Board2._x = 18;
    _root.Board2._y = 285;

    // Load board Board 3
    _root.createEmptyMovieClip("Board3",3);
    _root.Board3.loadMovie("board_object.swf");
    _root.Board3._x = 18;
    _root.Board3._y = 450;



    Here is the code inside of a movie clip inside the loaded board.swf file that stops working:
    code:


    textArr = ["id_txt","last_name_txt","first_name_txt",
    "mi_txt","dob_txt","loc_txt","sdate_txt","stime_tx t",
    "splanned_txt","stime1_txt"];

    pnum = 0;

    function fillTextFields(){
    nLen = xmlFileBoard.firstChild.childNodes[0].childNodes.length;

    trace("nLen = "+nLen);
    pnum == nLen ? pnum = 0 : pnum;
    trace("pnum = "+pnum);
    aNode = xmlFileBoard.firstChild.childNodes[0].childNodes[pnum];
    trace("aNode - "+aNode);
    aLen = aNode.childNodes.length;
    for(var x=0; x!=aLen; x++){
    _root.box.Board_box[textArr[x]].text = aNode.childNodes[x].firstChild.nodeValue;
    stime1_txt.text = stime_txt.text
    }
    };

    xmlFileBoard = new XML();
    xmlFileBoard.ignoreWhite = true;
    xmlFileBoard.onLoad = fillTextFields;
    xmlFileBoard.load("Mike.xml");

    f_btn.onRelease = function(){
    pnum++;
    fillTextFields();
    }

    b_btn.onRelease = function(){
    if (pnum != 0 ) {
    pnum = pnum -1;
    fillTextFields();
    }
    }



    Here is code that stops working in a button...
    code:

    on (press) {
    _root.box.upcoming_patient.gotoAndPlay(2);
    }



    I will keep searching the forums in the meantime...

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    add to frame#1 of board_object.swf -
    this._lockroot = true;

    this will allow syntax _root to operate correctly

  3. #3
    Member
    Join Date
    Oct 2006
    Posts
    41
    That worked great! Thx again AMD.

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