We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2762
    • 1,198 Posts
    Good works!! , very intersting! wink
      Free MODx Graphic resources and Templates www.tattoocms.it
      -----------------------------------------------------

      MODx IT  www.modx.it
      -----------------------------------------------------

      bubuna.com - Web & Multimedia Design
      • 30011
      • 7 Posts
      Does anyone have a good method of updating jpegs in a flash movie, I figured out how to do a text edit with xml. But when I try to send a template variable pointing to an image in the asset folder, flash does not recognise it as a url to an image...

      Any ideas?

      Cheers
        • 11206
        • 73 Posts
        I’ve updated images in a flash container, using modx.

        how are you trying to do this?

        I just pass the url to the image that is stored in the XML that i pass to my flash movie, and then load the image in flash using a MovieClipLoader .

        what errors are occuring for you?
          • 2911
          • 1 Posts
          When I’m logged in to MODX and am viewing my page with the flash Slideshare embedded in the page, everything looks great. But when I logout of MODX, the Slideshare presentation disappears. What’s going on?
            • 30011
            • 7 Posts
            grahoom,

            I hate to be a pain but could you post some code?

            Specifically the actionscript to pull the xml variables, and the code to place var in the MC?
            And perhaps the xml template if it is not too much trouble?


            Thanks so much.
              • 11206
              • 73 Posts
              Hello - timdiekman

              here is the xml I use (it’s a template) So it is filled with the values from the page.

              <?xml version="1.0" encoding="utf-8"?>
                    <document>
                     <title name="title" content_type="titletext"> [*pagetitle*]</title>
                     <title name="longtitle" content_type="titletext">[*longtitle*]</title>
                     <content name="content" content_type="bodytext">[*content*]</content>
                     <image name="homeimage" content_type="image">[*workhomepageimage_var*]</image>
                     <image name="mainimage" content_type="image">[*workmainimage_var*]</image>
                      <image name="thumbnailimage_on" content_type="image">[*workthumbimage_on_var*]</image>
                      <image name="thumbnailimage_off" content_type="image">[*workthumbimage_off_var*]</image>
              </document>


              here is an AS2 function that I use to load in the above content.
              function xmlLoader_Func(xml,ini,id,mc){
              	
              /*
              
              	var my_xml = new XML();
              	my_xml.ignoreWhite = true;
              	my_xml.ini = ini;
              	my_xml.onLoad = function(success){
              		var work_string : String = '';
              		if (success){
              
              			var pagecontent = this.firstChild.childNodes;
              			if(ini != true){
              				_root[mc].createEmptyMovieClip('work_' + id, id); // on each xml document loaded a mc for the work is created using 'work_' + id . 
              			}
              			
              			for(i = 0; i<pagecontent.length;i++){ // this cycles through the childNodes of the XML
              				if(ini == true){ // this if statement will return the string value for the values of the work documents.
              					work_string = pagecontent[i].firstChild.nodeValue;
              					_root.seperateContent_Func(work_string);
              				
              				}else{
              					
              					switch (pagecontent[i].attributes.name){  // this checks to see the name of the attribute of the child node, and then sets up a var for each item on the desired work mc
              						
              						case 'title':
              							_root[mc]['work_' + id].pagetitle = pagecontent[i].firstChild.nodeValue;
              						break;
              						
              						case 'longtitle':
              							_root[mc]['work_' + id].longtitle = pagecontent[i].firstChild.nodeValue;
              						break;
              						
              						case 'content':
              							_root[mc]['work_' + id].content_text = pagecontent[i].firstChild.nodeValue;
              						break;
              						
              						case 'homeimage':
              							_root[mc]['work_' + id].homeimage = pagecontent[i].firstChild.nodeValue;
              						break;
              						
              						case 'mainimage':
              							_root[mc]['work_' + id].mainimage = pagecontent[i].firstChild.nodeValue;
              						break;
              						
              						case 'thumbnailimage_on':
              							_root[mc]['work_' + id].thumbnailimage_on = pagecontent[i].firstChild.nodeValue;
              						break;
              						
              						case 'thumbnailimage_off':
              							_root[mc]['work_' + id].thumbnailimage_off = pagecontent[i].firstChild.nodeValue;
              							trace('!!-------!!');
              						break;
              						
              					}//end of switch statement
              					
              				} //end of if / else statement
              			} //end of for loop
              			if(ini != true){
              				_root.generateThumbs_Func(mc,'work_',id);
              				_root.generateMainContent_Func(mc,'work_','content_mc',id);
              			}
              		} //end of of(success)
              		
              	} //end of my_xml.onLoad
              	my_xml.load(xml);
              }
              


              and here is a code snippet from a the function generateMainContent_Func :: this part of the function loads an image.
              	var loadListener:Object = new Object();
              
              	loadListener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number):Void {
                  	trace(">> loadListener.onLoadComplete()");
                  	trace(">> =============================");
                  	trace(">> target_mc.: " + target_mc._target); // 0
              		_root.loadtotal++;
              	}
              
              	loadListener.onLoadInit = function(target_mc:MovieClip):Void {
                  	trace(">> loadListener.onLoadInit()");
                  	trace(">> =============================");
                  	trace(">> target_mc.: " + target_mc._target); // 315
              	}
              
              	var mcLoader:MovieClipLoader = new MovieClipLoader();
              	mcLoader.addListener(loadListener);
              	mcLoader.loadClip(url + _root[parent_mc][work_mc + id].mainimage, _root[parent_mc][content_mc]['work_' + position]['image']);
              


              as you can see above I am using loadClip to load the mainimage variable from the xml onto an mc called _root[parent_mc][content_mc][’work_’ + position][’image’] - the reason why I am loading it this way is that there are 15 different "sections" to be loaded (so that means 15 different pages from modx) all to be loaded into one xml container, when the site goes live i’ll send a link - but it isn’t quite there yet.

              hope that helps? if not let me know and I’ll try and explain how it works a bit better. This is all done in AS2 as i needed to make sure that I could compile the site to flash 8.
                • 30011
                • 7 Posts
                Thanks heaps!

                I will have a crack at it today and let you know my results...

                Cheers

                TD