As of yesterday I'm a "flash programmer", since it's the first time I've touched flash I had some difficulties. The first is the dev-env, Adobe does (almost) everything to be "not like M$". In some cases it hurts... P.S. if somebody knows what's the keys for the stepping in the debug mode (F10 & F11 in the VS) let me know...
The second thing was an interesting "feature": XML is loaded in the background (async = true), but there's no telling when it finished loading.
The bypass is use a "timer", I used the following code:
//Load the XML
_global.setTimeout(TimeoutFunc,1000,"");
function TimeoutFunc() {
if (my_xml.loaded) {
//The XML was loaded...
} else {
//Check again, you might wish to add a counter for the cases
//Execution must stop and not re-evaluate it every second.
_global.setTimeout(TimeoutFunc,1000,"");
}
}
The strange thing is that a 100ms timeout makes the debugger crash! And with the "feature" of not saving the other files before running them. I swore like sailor on a bad day.
Besides this effect, flash looks like a reasonable scripting enviroment. It's not a real programming heaven, but it's certainly not HELL like VB6. Though a better support for some features would be good.
Thursday, October 18, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment