Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / September 2006



Tip: Looking for answers? Try searching our database.

Static vs. Dynamic XML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MaveK - 28 Sep 2006 21:59 GMT
Hello all,

I have been stumped on this one for over a year now. I have created a Flash
Map that functions properly with a static XML file but when I try to load a
dynamic XML generated my ColdFusion I get no results. The example can be found
at: http://beginning.achel.org/map/works.html The one that does not work is at
http://beginning.achel.org/map/

This map should load the different states that are in the XML file but instead
it does not load any of them. The two different XML files can be found at:
http://beginning.achel.org/map/states.xml and
http://beginning.achel.org/map/states.cfm An interesting note: Firefox does not
recognize the cfm file as a XML file but IE does. This may be based on the file
extension.

The Action Script is exactly the same except that it references adifferent
file. The Flash works when published for Flash Player 6 but when I try to
publish for Player 8 even the static XML does not work.

I am probably over symplifying this but it seems logical to me. Please let me
know if you need any more information for this problem. I will post more as I
play around with it.

Thanks!

function Org(state, acronym, name, address1, address2, city, zip, email, url){
  this.state = state;
  this.acronym = acronym;
  this.name = name;
  this.address1 = address1;
  this.address2 = address2;
  this.city = city;
  this.zip = zip;
  this.email = email;
  this.url = url;
}

function States(){
  var e = OrgsXML.firstChild;
  if (e.nodeName == "STATES") {
    e = e.firstChild;
    aStates = new Array();
    while (e != null) {
     this.map[e.attributes.state].enabled = true;
//     this.map[e.attributes.state].gotoAndStop("Over");
      var h = new Org(e.attributes.state,
                      e.attributes.acronym,
                      e.attributes.name,
                      e.attributes.address1,
                      e.attributes.address2,
                     e.attributes.city,
                     e.attributes.zip,
                     e.attributes.email,
                     e.attributes.url);
      aStates.push(h);
      e = e.nextSibling;
    }
  }
}

var OrgsXML = new XML();
OrgsXML.ignoreWhite = true;
OrgsXML.onLoad = function(success:Boolean) {
    if (success) {
        States();
    } else {
        trace("Load Status: error")
    }
};
OrgsXML.load("states.cfm");

function loadStates() {
    for (i in this.map) {
       if (this.map[i] instanceof Button) {
        this.map[i]._visible  = false;;
       }
    }
    for (var i:Number = 0; i < aStates.length; i++) {
        this.map[aStates[i].state]._visible = true;
    }
}
MaveK - 29 Sep 2006 21:39 GMT
OK, I have narrowed down the problem... but I still need HELP!!!

First, the version problems were related to case sensitivity. (fixed)

Second, the dynamic XML data still does not load (in time). It appears that
the CFM file is not loading quickly enough and the flash file generates before
it gets any/all the data. I believe this is the case because when I load the
file the first time in IE none of the data appears but if I refresh then the
correct data displays. I thought that I had written the AS to wait for the
onLoad to finish loading the file before proceeding. (see attached code)

This also begs the next question, why is IE caching the dynamic data? The
reason that I am using a CFM page is that I want it to be up to date. In
FireFox I never get the data to display because it appears to be getting the
data each time.

One other thing, how do you debug in the browser? I am using dynamic data off
the server and therefore can't debug it until I upload the file to the server.
I tried downloading the Flash Player 9 debugger but that appears to only work
for Flex. Is this correct?

Thanks again to all!

var OrgsXML = new XML();
    OrgsXML.ignoreWhite = true;
    OrgsXML.onLoad = function(success:Boolean) {
        if (success) {
        //    trace("Load Status: Sucess");
            _global.x = States();
        } else {
            trace("Load Status: error");
        }
    };

    OrgsXML.load("states.cfm");
dan mode ->Adobe Community Expert - 29 Sep 2006 23:51 GMT
> Second, the dynamic XML data still does not load (in time). It appears
> that
[quoted text clipped - 6 lines]
> correct data displays. I thought that I had written the AS to wait for the
> onLoad to finish loading the file before proceeding. (see attached code)

If this is the case, tell the timeline not to proceed until it is loaded.

> This also begs the next question, why is IE caching the dynamic data? The
> reason that I am using a CFM page is that I want it to be up to date. In
> FireFox I never get the data to display because it appears to be getting
> the
> data each time.

IE loves to cache anything it can.  IE doesn't know that your content is
dynamic, try putting a random variable at the end of your load.
randomVar = Math.random();
OrgsXML.load("states.cfm?random="+randomVar)

> One other thing, how do you debug in the browser? I am using dynamic data
> off
[quoted text clipped - 3 lines]
> work
> for Flex. Is this correct?

Yeah, you can't see the cfm dynamic data until it is processed by cfm, which
is on the server.  If you had cfm on your local machine as well as the
source data, then you could do it.  Until then, you'll have to do your
testing on the server.

Signature

Dan Mode
--> Adobe Community Expert
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
*THE online Radio* http://www.tornadostream.com
*Must Read* http://www.smithmediafusion.com/blog

MaveK - 30 Sep 2006 15:00 GMT
> If this is the case, tell the timeline not to proceed until it is loaded.

I thought that I was telling the AS not to proceede  untill the data was
loaded with the onLoad statement. Does this code work or do I need somthing
else?

OrgsXML.onLoad = function(success:Boolean) {
    if (success) {
            _global.x = States();
    } else {
        trace("Load Status: error");
    }
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.