Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
MaveK #1
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
-
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... -
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.... -
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... -
Static vs. Dynamic
What is the overall difference between static html and dynamic html? -
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... -
MaveK #2
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
-
dan mode ->Adobe Community Expert #3
Re: Static vs. Dynamic XML
> Second, the dynamic XML data still does not load (in time). It appears
If this is the case, tell the timeline not to proceed until it is loaded.> 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)
IE loves to cache anything it can. IE doesn't know that your content is> 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.
dynamic, try putting a random variable at the end of your load.
randomVar = Math.random();
OrgsXML.load("states.cfm?random="+randomVar)
Yeah, you can't see the cfm dynamic data until it is processed by cfm, which> 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?
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
-
MaveK #4
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
-
dan mode #5
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



Reply With Quote

