Static vs. Dynamic XML

Ask a Question related to Macromedia Flash Data Integration, Design and Development.

  1. #1

    Default Static vs. Dynamic XML

    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: [url]http://beginning.achel.org/map/works.html[/url] The one that does not work is at
    [url]http://beginning.achel.org/map/[/url]

    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:
    [url]http://beginning.achel.org/map/states.xml[/url] and
    [url]http://beginning.achel.org/map/states.cfm[/url] 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 Guest

  2. Similar Questions and Discussions

    1. Dynamic and Static Site
      I have not used Dreamweaver before and now I am also trying to add dynamic pages to our site. I will be using ColdFusion to do this. The question...
    2. Converting Static to Dynamic -
      Hey Y'all, I just launched a new website a couple of days ago - http://www.v4honda.com It is the perfect example of why a site should be dynamic....
    3. Dynamic to static
      Is there a way for me to take a table that is being built dynamically and have it be stored as static information in memory somehow so that I can...
    4. Static vs. Dynamic
      What is the overall difference between static html and dynamic html?
    5. Dynamic and Static IP
      I was wondering if you can have dynamic and static IP addresses on the same network. The network will include PCs with Win98, W2K, and XP operating...
  3. #2

    Default Re: Static vs. Dynamic XML

    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");

    MaveK Guest

  4. #3

    Default Re: Static vs. Dynamic XML

    > 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)
    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
    > 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?
    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.


    --

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



    dan mode ->Adobe Community Expert Guest

  5. #4

    Default Re: Static vs. Dynamic XML

    > 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");
    }




    MaveK Guest

  6. #5

    Default Re: Static vs. Dynamic XML

    Well yes, that says if it loads the xml successfully then run States().
    But, it doesn't say not to proceed until the xml it fully loaded and parsed.
    You need to add something to the States() that says once the parsing is done
    then proceed.


    --

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

    "MaveK" <webforumsuser@macromedia.com> wrote in message
    news:eflt99$t0g$1@forums.macromedia.com...
    >> 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");
    > }
    >
    >
    >
    >

    dan mode Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139