5 Replies Latest reply on Jul 1, 2008 11:53 AM by dbento

    Flash and Director

    dbento Level 1
      I have build a flash menu to use in my director movie.
      What i want is simple tasks, as quit the app from a flash button.

      If i could send vars from flash to director is enough, but i couldn't do that. I couldn't find any examples to do something like that.

      Can anyone help me?
        • 1. Re: Flash and Director
          Level 7
          You can send commands from flash to director with getURL

          for example, to quit the Director movie by clicking on a button in a
          flash swf:

          on(release){
          getURL("lingo: halt");
          }

          to send Director to a frame labeled "menu", you could use this:

          on(release){
          getURL("lingo: go \"menu\"");
          }

          note how I escaped the quotes with slashes...
          • 2. Re: Flash and Director
            Level 7
            Also, you can get and set variables in Flash from Director with

            getVariable()
            setVariable()

            check out the docs for syntax and examples

            You must save the swf as Flash 8 or earlier if you are using Director MX
            2004. You can use the Flash 9 format if you are usind Director 11.
            Either way, you can not use AS3. You must use AS2.
            • 3. Re: Flash and Director
              duckets Level 1
              As well as directly using the "lingo:" event, in the flash GetURL command, you can also call event handlers directly. I find this method preferable, as it means you don't end up with lingo code distributed throughout your your flash file!

              My favoured method: In Director, place a behaviour on the flash sprite.
              Then create handlers in that behaviour for each type of event that you want to trigger from flash. Eg,

              on quit me
              -- your quit code here
              end

              Then, in flash, you can call this handler by using:

              GetURL("event:quit");

              You can also pass a parameter along to the handler, eg:

              GetURL("event:myHandlerName 5");

              Or if you want to pass a string, you need to escape the quotes for that string:

              GetURL("event:myHandlerName \"a string parameter\"");

              hope this helps,

              - Ben
              • 4. Flash and Director
                Sharkmenace Level 1
                you can also directly access the swf sprite with dot syntax from director. eg:

                sprite("debugPanel").debug_text_field1.text = "hello"
                • 5. Re: Flash and Director
                  dbento Level 1
                  What i want is simply to call director functions as "quit" or "go to frame". Thanks for your help. This all helps to what i need.

                  I used the first help:

                  on(release){
                  getURL("lingo: halt");
                  }

                  Thanks