A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: KEEP having problem with XML duplicateMovieClip

  1. #1
    Junior Member
    Join Date
    Mar 2007
    Posts
    13

    KEEP having problem with XML duplicateMovieClip

    Can anyone please explain why the code below does not load the XML text into myTextArea

    this is supposed to duplicate a movieclip with the instance name "story" and populate it with "headline" text from the XML..... check it out... this code actually DOESN'T work!

    PHP Code:
    //Load xml...blah blah blah...

    for (n=0n<maxnumn++) {
                
        
    storX =30;
        
    storY = (story._height*n)+buffer;
        
        
    specs xml.firstChild.childNodes[n].attributes;
        
    //menu
        
    duplicateMovieClip(story,"story_"+nn);
        
    stor = eval("story_"+n);
        
    stor._y storY;
        
    stor._x storX;
        
            
    stor.headline specs.headline;//<---this sets the variable
        
    stor.myTextArea.text this.headline;//<----this is not working, WHY?!
        
         //can someone please explain why this does not work instead of just writing down the answer..?
         
         
    stor.onRollOver = function(){
        
    trace(this.headline);//<----this IS working... what the hell? how can this work, but not above?

    Last edited by deanshelton1334; 05-11-2008 at 05:08 PM.

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    have you tried:

    stor.myTextArea.text = specs.headline;

    instead?

    because (I believe) any reference to this would mean the XML doc.

    and NOT the duplicated movieClip.

  3. #3
    Junior Member
    Join Date
    Mar 2007
    Posts
    13
    yes i have tried that... and it seems like it should work...but alas... it does not.
    Please, any other ideas?

    -Dean

  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    can you trace out the:

    this.headlines;

    or how about the:
    specs.headline; even?

    if BOTH are undefined..then the var IS NOT getting populated correctly.

    alternately.. maybe try giving your duplicateMovieClip() method a var name:


    var stor = duplicateMovieClip(story, "story_"+n, this.getNextHighestDepth());
    stor._y = storY;
    stor._x = storX;
    stor.headline = specs.headline;

    and try that... etc..


    however being that it is a component..

    "I" personally believe it to be a 'BUG' in the initialization of the textarea component..

    I bet if you made a super simple setInterval() function that gets called even 100 milliseconds after you duplicate the clip it would populate correctly..

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