MACROMEDIA DIRECTOR MX 2004-GETTING STARTED WITH DIRECTOR Manual de usuario Pagina 32

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 44
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 31
execDirectorScript(spriteRef, URL, scripttext) - This event is generated by
WebXtra when the Javascript interpreter in the browser attempts to use the
window.external.execDirectorScript(scripttext) function. It is a way to extend the
HTML DOM directly: you can pass single line scripts or multiple line ones. For
reference, check the SCRIPTING sample at the WebXtra tutorials and samples
page. You can also use it to pass any sort of message to Director, as the full
scripttext is available to Director for parsing, in either Lingo or JS.
Here are some examples:
Lingo examples:
on execDirectorScript spriteRef, scripttext
-- Simply execute a snippet of Lingo passed directly:
do scripttext
-- Alternatively, you could parse the scripttext, and do whatever you want with the
text passed.
-- For example the scripttext could be a message like "lingo:reloadMovie"
if scripttext contains "lingo:" then
--use the do command to execute the "reloadMovie" handler
do URL.char[7..the number of chars in URL]
end if
end
JavaScript syntax example:
function execDirectorScript(spriteRef, scripttext ){
// Simply execute a snippet of JS passed directly:
eval(scripttext)
// Alternatively, you could parse the scripttext, and do whatever you want with the
text passed.
// For example the page could contain a link that points to "js:reloadMovie"
if (URL.indexOf("js:") == 0) {
// parse the rest of the URL here, and pass it to the do command for execution
Online Help
32
Vista de pagina 31
1 2 ... 27 28 29 30 31 32 33 34 35 36 37 ... 43 44

Comentarios a estos manuales

Sin comentarios