A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: movie clip problems and xml variables

  1. #1
    Member
    Join Date
    Jul 2001
    Posts
    61
    Note: The fla is single frame multi_layer with the MoviePlayer instance on a layer. The problems I anm having are having the Movie Clip go to a frame in the movie clip and stay there: and loading the frame by a variable generated by flashframeno. This is the code I am using to extract the values and an example of the code that goes to the frame and then returns to the first frame. I am sure others have experienced this problem.



    function ParseXML () {
    myxml = xml1.firstChild;
    if (myxml.hasChildNodes()) {
    var cbtdata = myxml.childNodes;
    }
    for (var z = 0; z<cbtdata.length; ++z) {
    if (cbtdata[z].nodeName.toLowerCase() == record) {
    var cbtdata = cbtdata[z].childNodes;
    for (var z = 0; z<cbtdata.length; ++z) {
    if (cbtdata[z].nodeName.toLowerCase() == "flashframeno")
    {
    var flashframeno = cbtdata[z].firstChild.nodeValue;
    }

    if (cbtdata[z].nodeName.toLowerCase() == "graphicname") {
    var getgraphicname = cbtdata[z].firstChild.nodeValue;
    with(MoviePlayer)
    loadMovie (getgraphicname, "MoviePlayer");
    setProperty (MoviePlayer, _x, 0);
    setProperty (MoviePlayer, _y, 0);
    MoviePlayer.gotoAndStop(flashframeno) // doesn't display the frame generated by the variable in the previous "if" statement..
    Change the MoviePlayer to read

    MoviePlayer.gotoAndStop(3) // Displays the frame briefly and drops back to the first frame.
    }


  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    Huh? Goes to the frame then returns the first frame....

    I guess I'm a little lost...

    Also - why do you do this:

    var cbtdata = myxml.childNodes; ???

    Is there any whitespace in your XML document?? That might mess you up....

    Speaking of messing you up - are you sure that the XML document is 'correct'? In other words - you're sure that you're not asking it for something that doesn't exist??

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