Hi , weirdness , I have a flash object , during it lifetime it has to use eval()
//variables already loaded e.g count_1 - count_7 exist and can be traced
// 'x' exists and can be traced
_root.num_ims = eval('count_'+x);
if x = 5 and count_5 = 10 then _root.num_ims should equal 10 and indeed it does when testing (in flash) as expected , but when using in the output swf in the browser the eval() call is failing , everything else works just fine.
MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
Well, never having worked with ActionScript I can't say anything final, but I know that the compact ECMAScript specification allows dropping of eval and the like for speed when embedding the language.
I suggest you replace the variables count_1 through count_7 with an array count instead, and use array notation count[x] instead of eval('count_'+x). Additionally, array lookup is many times faster than eval, so that might even speed the execution up.
Hey Liorean , that worked a treat , the variables come via GET so I can't get directly at the array , but simply loading the loaded variables into an array indeed did the job
I swear I have used eval in flash-web-applications before , however since your suggestion works I am keeping quiet so cheers !
MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)