This is a lot easier in DHTML runtimes than for swf runtimes, because there
is a javascript
interpreter built into DHTML runtime.

You can just use "eval" to evaluate expressions. An  equivalent of
constraints  can be built at runtime, by registering
explicitly for events, but if you want to run the Laszlo constraint analyzer
to extract the dependencies out
of a javascript expression, it has to be done
through the compiler.

The swf runtime has no Javascript interperter available to it, and 'eval'
does not really do anything useful, so
it is much more difficult to do what you describe. Our debugger in swf
actually sends javascript expressions back
to the LPS server, where they are compiled by our compiler. You could do
that too, using the same mechanism, I suppose. If you look at how the
debugger works, it sends a request to the server with the query arg
"lzt=eval" and "script=your-javascript-expression...", and it returns a swf
movie, that when loaded by loadMovie, will execute that expression.



On Mon, May 19, 2008 at 5:11 AM, Marco Lettere <[EMAIL PROTECTED]>
wrote:

> Hello everybody,
> I would like to now if there's a way (in OL 4) to generate script code
> from inside OL applications themselves.
> I'm looking for something like a textarea where I can write a javascript
> and a button that, when clicked, executes the javascript code contained
> in the textarea.
> I was actually able to generate a <script> node in my canvas. But I do
> not know how to set code inside it. Well I actually do not know if this
> is even possible.
> Moreover I'm interested in doing the same with constraints (an input
> field where I can write a constraint string and a button that, when
> clicked, applies the constraint to one attribute of a OL DOM node).
> Thank you all,
> M.
>



-- 
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to