Hi Forum,
anyone have any suggestions on how to dynamically load an external block of code (e.g. a txt file) at runtime - i.e. a runtime equivalent of #include
thanks
ascii_null
Hi Forum,
anyone have any suggestions on how to dynamically load an external block of code (e.g. a txt file) at runtime - i.e. a runtime equivalent of #include
thanks
ascii_null
It’s not possible just like that. There are a few code parsers that could do the job though (check www.flashcomponents.net for instance).
Thanks Ilyas Masa,
I had a look around and didn’t see anything that really matched what I wanted - had you a particular component in mind? I’ve looked at parsers before and played around a bit with wddx and other soap protocols but I’ve yet to find one that supports dynamic function declaration.
thanks,
ascii_null
You’re probably better off waiting for Sen to give you a more precise answer
I really have no clue if you can, but out of curiousity…
Would it work if you loaded in the actions via an external .swf file? I can’t test it right now and this probably wouldn’t be the most efficient way anyway, but I wonder if it would work out.
Also: Why must these actions be imported during runtime instead of called in using #include or even included in the movie itself from the start.
Hi lostinbeta,
embedding functions in external swfs will work fine (you just need to be careful with scoping) but unless you create the swfs dynamically using a server ext like Ming then you are still relying on a static source. I would like to define functions on-the-fly at runtime.
In JavaScript/ECMA 262 it’s straightforward enough using evaluate() but the AS eval() is far more limited in it’s scope.
Oh, I gotcha.
As Ilyas said, if anyone has your answer it is Sen[ocular], but as far as I know I don’t believe it is possible.
the component at flashcomponents is:
http://www.flashcomponents.net/component.cfm?nav=2&id=118
This is not perfect though. The results it IS able to achieve is very impressive nonetheless. Still, it needs to parse the text through actionscript and interpret it through actionscript making it a chore and depending on the code, quite slow.
The big solution is loading in a movie with the actionscript embedded within it. This would still, however, require you to create and compile a new swf with that code, but you wouldnt need to touch the original file. You can compile server-side with something like ming however
Thanks, senocular ,
that’s just what I’m looking for.
ascii_null
Now that is very cool =)
:: Copyright KIRUPA 2024 //--