-
·»¤«·
XML.onLoad(success) doesn't work like it used to?
taken from a Flash MX project, works in SA player 6, MX IDE, IE player 7, but not in a browser with player 8:
code:
//SITE DATA LOAD
_global.siteXML = new XML();
XML.prototype.ignoreWhite = true;
siteXML.load("site.xml");
siteXML.onLoad = function(success){
if(success){
//snipped
}else{ //if XML failed to load, show a error message textfield
_root.createTextField("txt",1,0,0,100,20);
txt.text = "XML load failed.";
}
}
The textfield never shows up in F8...
What's going on? It's just a simple onLoad(success) method...
I'm on a Pentium III / XP, tried Mozilla, and IE doesn't have F8 installed(and it works on IE, player 7)
Last edited by >flashl!ght<; 09-06-2005 at 11:32 AM.
>flashl!ght<
All the normal names were taken.
Ron Paul was right.
-
-
·»¤«·
drat.
In Mozilla/Netscape?
>flashl!ght<
All the normal names were taken.
Ron Paul was right.
-
Total Universe Mod
I've always placed my load after the onLoad. Can't remember where I learned that but it might help.
-
Your code works fine on Firefox and IE, Mac and Windows.
-
·»¤«·
Great, my computer is possessed. What other factors might be causing it to fail? The exact code above does not work for me in Mozilla 1.7.8 with player 8. I'm about to install FireFox on this machine...
PS - thanks jAQUAN, that didn't do anything though. Like I said, it works in all other cases but player 8 on my machine(which is installed in Moz)
>flashl!ght<
All the normal names were taken.
Ron Paul was right.
-
If you haven't already, file a bug report with Macromedia.
http://www.macromedia.com/go/fp_public_beta_feedback
-
Senior Member
Why are you using _global? Should be avoided as much as possible.
- The right of the People to create Flash movies shall not be infringed. -
-
·»¤«·
Really, I appreciate the crits on my coding, I'm not an AS guru, but my code works already. On all previous versions of Flash, but something is amiss in player 8 somewhere. The fact that it worked properly(problem was not reproducable) for others using player 8 shows it's a very system specific problem. Yes, I have filed it with MM(crosses fingers).
Incidentally, why avoid _global as much as possible? I'm a _global junkie, I use it as much as possible. Testing also shows you get the fastest results with _global referencing. And why in this case did I use it? Because of all my references to the source XML from nested movieclips and functions and such... much easier when I know I'm dealing with a globally scoped reference to my XML.
>flashl!ght<
All the normal names were taken.
Ron Paul was right.
-
Senior Member
I don't have experience with other programing languages, basically none, but from what I learnt from others is that _global is basically banned in some languages such as java for example. Somebody with more experience may make some comment on this.
The main reason not to use _global frequently is that that a _global var can be accessed from everywhere. However, accession is something which should be limited (in AS2) as much as possible. That is why people use "private" vars. Now think you have a complex script network and there is more than one programmer who contributed. If you use _global you will run into trouble if somewhere is another var with the same name. So I limit myself to relatively unimportant features using _global such as the style of components if I want all of them to have the same style. In that case it will save coding. Otherwise I usually refer to the exact path of the var and don't run into problems.
It is my opinion and probably others have different opinions. Once some time ago Mike Chambers from MM brought this up here and some of my knowledge I learnt from him.
- The right of the People to create Flash movies shall not be infringed. -
-
·»¤«·
Fair enough. I think for the scope of most of my projects _global is alot of help and not a concern. When making components and such though, I certainly agree; I always keep everything local.
>flashl!ght<
All the normal names were taken.
Ron Paul was right.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|