dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: css/xml with dynamic text fields

  1. #1
    Junior Member
    Join Date
    Dec 2000
    Posts
    21

    css/xml with dynamic text fields

    I'm having trouble applying CSS styles to dynamic text boxes created in a duplicateMovieClip loop. None of the text is displaying in any of the text boxes, but I can obviously get a trace of them. I'm down to one hair left on my head!

    Thanks for any help...

    Here is the code:

    ActionScript
    Code:
    myText = _root.main_mc.details_txt.text;
    myText.html = true;
    myText.wordWrap = true;
    myText.multiline = true;
    myText.label.condenseWhite=true;
    
    newStyle = new TextField.StyleSheet();				
    newStyle.load("ad.css");
    myText.styleSheet = newStyle;
    
    /******************************/
    
    
    var myXML:XML = new XML();
    myXML.ignoreWhite = true;
    myXML.load("estates.xml");
    myXML.onLoad = function(success) {
    		if (success) {
            	var node = myXML.firstChild.childNodes;
            	var houses:Number= myXML.firstChild.childNodes.length;
    			
    	for (var i = 0; i < houses; i++) {
    	var details:Number = myXML.firstChild.childNodes[i].childNodes.length;
    
    	duplicateMovieClip (_root.main_mc, "main"+i, i);
    	_root.main_mc._y = _root["main"+i]._y + 65;
    					
    	for (var j = 0; j < details; j++) {
    
    	myText = _root["main"+i].details_txt.text;
            myText += node[i].childNodes[j].firstChild.nodeValue;	
    					
            trace(myText)			
    
    			 
    			 }
    		}
    	}
    };
    XML:
    Code:
    &lt;singlefamily&gt;
    
    &lt;house&gt;
    	&lt;town&gt;Ashfield&lt;/town&gt;
    	&lt;type&gt;Antique Cape&lt;/type&gt;
    	&lt;price&gt;$335,000&lt;/price&gt;
    	&lt;image&gt;70203018.jpg&lt;/image&gt;
    &lt;/house&gt;
    
    &lt;house&gt;
    	&lt;town&gt;Conway&lt;/town&gt;
    	&lt;type&gt;Cape&lt;/type&gt;
    	&lt;price&gt;$1,450,000&lt;/price&gt;
    	&lt;image&gt;70153211.jpg&lt;/image&gt;
    &lt;/house&gt;
    
    &lt;house&gt;
    	&lt;town&gt;Hadley&lt;/town&gt;
    	&lt;type&gt;Executive Cape&lt;/type&gt;
    	&lt;price&gt;$399,900&lt;/price&gt;
    	&lt;image&gt;70213018.jpg&lt;/image&gt;
    &lt;/house&gt;
    
    &lt;/singlefamily&gt;


    CSS
    Code:
    town {
    color: #ffffff;
    font-family: verdana;
    font-size: 20px;
    font-weight: normal;
    }

  2. #2
    nobody
    Join Date
    Aug 2002
    Posts
    269
    I have the same problem. Have you managed to do this?
    kra, kra

  3. #3
    Junior Member
    Join Date
    Dec 2000
    Posts
    21
    Nope...still having the same problem. just does not show up with dynamic text fields

  4. #4
    nobody
    Join Date
    Aug 2002
    Posts
    269
    Try changing properties of textField:
    embedFonts, html, ...
    kra, kra

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