A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: loadmovie and xml issue

  1. #1
    Member
    Join Date
    Jul 2004
    Posts
    46

    loadmovie and xml issue

    Ok, I have gone through what I believe is all the posts on this subject and haven't found a clear answer. Basically I have my main .swf. Within it when a button is pushed, it uses the attachMovie. Also a loadMovie function is called to load an external swf intop that attached movie. No problem. The loaded swf loads an XML file of all kinds of content. Again this is no problem. Of course when I self test the swf the content loads fine, however when viewed within the full site the XML content does not appear. Again I have seen similar questions, but no clarity. Could anybody please help? Here is the code.
    This in the main movie calling the attachMovie and loadMovie functions:
    Code:
    onClipEvent (enterFrame) {
    	_root.mc.bt12.onRelease = function(){
         	_root.mc.attachMovie("popup","popup",_root.getNextHighestDepth());
    	 	popup._x = 0;
    	 	popup._y = 275;
    	 	_root.mc.popup.holder.loadMovie("schedule.swf");
         	//_root.mc.enabled=false;
    	}
    }
    This called in loaded swf.
    Code:
    stop();
    this._lockroot = true;
    _root.myXML = new XML();
    _root.myXML.onLoad = DisplayData;
    _root.myXML.load("calendar.xml");
    //next 3 lines for my scroller in the text field
    _global.currentText = 0; 
    _global.countDownToTop = 5;
    
    _global.textInterval =  setInterval(moveTextDown, 1000); 
    
    function DisplayData(success)
    {
    	if (success) {
    		xmlOutput.xmlOutput.htmlText = this.body.childnodes.join('').split('<a ').join('<font color="#3333ff"><u><a ').split('</a>').join('</a></u></font>');;
    	}
    }
    XML file is just a typical XML file

  2. #2
    Junior Member
    Join Date
    Sep 2006
    Location
    Brooklyn, NY
    Posts
    4
    why is the top code contained in an onEnterFrame function?

  3. #3
    Member
    Join Date
    Jul 2004
    Posts
    46
    That is just me being lazy. It doesn't necessarily have to be onEnterframe. I just have that particular type of format on other clips on my main movie. I suppose I could have went with:

    Code:
    bt12.onRelease = function () { blah.. blah.. blah...};
    Do you think this might prevent it from loading the content within the attached movie/load movie?

  4. #4
    Junior Member
    Join Date
    Sep 2006
    Location
    Brooklyn, NY
    Posts
    4

    ...doubt this will solve your problem, but

    see next post
    Last edited by flashgordonMX; 09-18-2006 at 08:01 PM.

  5. #5
    Junior Member
    Join Date
    Sep 2006
    Location
    Brooklyn, NY
    Posts
    4

    ...doubt this will solve your problem, but

    i would move all this stuff out of onEnterFrame. any code contained in the onEnterFrame handler is executed repeatedly at the frame rate of the movie. This means you're defining this function over and over again -- probably 20 times per second. whether or not this is causing the problem (and it's probably not), it doesn't seem like good practice. As far as i can tell, this _root.mc.bt12.onRelease function needs only to be defined in the main body of your code. it will still only be called when the button is pressed.

    as for the problem you posted about, i won't profess to be able to solve it from here, but i would look into the ._root and lockroot between the 2 movies.

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