A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Help with XML Viewer

  1. #1
    ...in human form
    Join Date
    Aug 2002
    Posts
    188

    Help with XML Viewer

    So I'm implementing the XML viewer by Eric Entenman in my project. I have it nested in another movie. I've got it displaying the XML properly except the text continues off the stage actually displaying the whole document (though I can't see it). As such the scrollbar fuctions don't work because it thinks the whole document has already been displayed. Anyone have an idea what could be causing this or how i might fix it. The original is here

    http://www.flashkit.com/movies/Utili...2277/index.php

    My version isn't exactly like this but rather close.
    Incarnations

  2. #2
    ...in human form
    Join Date
    Aug 2002
    Posts
    188
    So this is the code causing the problem I think:

    Code:
    stop ();
    var count;
    function showhide(){
    	if(p_m == "-"){
    		p_m = "+"
    		count = countvisible();
    		for(i=startnum + 1;i<=_root.level + 1;i++){
    			setProperty ( "/Viewer/main/el_" + i, _y, getProperty("/Viewer/main/el_" + i ,_y) -  20 * count);
    			who = eval("/Viewer/main/el_" + i + ":whohidme");
    			if(i<=endnum and ((who == "el_" + startnum) or (who == null))){
    				setProperty ( "_level0/main/el_" + i, _visible, false );
    				eval("/Viewer/main/el_" + i + ":whohidme") = "el_" + startnum;	
    			}
    		}
    	}else{
    		p_m = "-"
    		for(i=startnum + 1;i<=_root.level + 1;i++){
    			setProperty ( "/Viewer/main/el_" + i, _y, getProperty("/Viewer/main/el_" + i ,_y) +  20 * count);
    			who = eval("/Viewer/main/el_" + i + ":whohidme");
    			if(i<=endnum and ((who == "el_" + startnum) or (who == null))){
    				setProperty ( "_level0/main/el_" + i, _visible, true);
    				eval("/Viewer/main/el_" + i + ":whohidme") = null;
    			}
    		}
    	}
    }
    function countvisible(){
    	var ad = 0;
    	for(i=startnum + 1;i<=endnum;i++){
    		if(getProperty("_level0/main/el_" + i,_visible)){
    			ad++;
    		}
    	}
    return ad;
    }
    When I debug the count variable is coming back undefined. This I assume is related to the countvisible function. Basically none of the nodes (referenced by el_+i) are returning a false _visible and such they all are being displayed. I hope this isn't too abstract. Any help is greatly appreciated.
    Incarnations

  3. #3
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    At the beginning of your code you define count as a local variable by writing var count. Since count is local and not filled with any value it will be undefined.

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