4 Replies Latest reply on Dec 4, 2006 1:48 PM by Newsgroup_User

    Flash sprites user response

    Level 7
      When integrating Flash with Director - I have always in the past done the
      following:


      on (rollOver) {
      getURL ("lingo:cursor 280");
      }

      on (rollOut) {
      getURL ("lingo:cursor 0");
      }


      on (release) {
      getURL("event: gotoQ3PDF");
      }



      I have always done the above as flash objects do not respond to mouse
      events - on rollOver and rollOut the basic, single lingo command to change
      the cursor, then on release I am executing an event (to perform multiple
      lingo commands) restoring cursor, goto frame/marker, etc...


      Has anything changed recently where you can do anytype of "global"
      command/script the does this across the board or does it still have to be
      hand-coded for each button in flash?? Our London office is doing some
      elements for us (in the US) for a CD project where there is a number of
      buttons in multiple flash movies....


      Thanks in advance!!!


        • 1. Re: Flash sprites user response
          Level 7
          What version of Director and what version of Flash are you working with?

          There is a Flash cursor behavior in the Director Library that will
          handle the cursor change in Director, so you don't have to use getURL
          for that part.

          What sort of action do you want to perform with these Flash buttons?
          From you example it looks like you want some simple navigation control
          in Director. Is each button a unique Flash .swf? Or do you have a number
          of buttons in one Flash .swf? If each button is separate, then you could
          just write a behavior as if the Flash sprite was any other button.

          If you have multiple buttons in any given .swf then you'll have to send
          out a message from the .swf to initiate an action. There is a
          mouseOverButton property for Flash members, but it can only tell if the
          cursor is over a button, not a particular button.

          To give you flexibility and maybe simplify things, you could use a
          getURL function in a behavior and set up a naming convention for your
          Flash buttons. For instance, if you have four buttons in a Flash .swf,
          name their instances sequentially, "one", "two", etc. then you can write
          a simple actionscript function for the .swf:

          var buttonArray:Array = new Array(one,two,three,four);

          for (i in buttonArray) {
          buttonArray .onRelease = function() {
          getURL(this);
          }
          }

          this will send the name of the button instance that was clicked on to
          the Director movie.

          Then you can just place a behavior like this on the Flash sprite:

          on getURL me,data
          if data contains "one" then ....
          end

          or use a case statement to parse out the string that was sent from the
          Flash .swf.

          This might at least simplify the Flash development process.

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: Flash sprites user response
            Level 7
            Thanks Rob --

            Dir MX2004 (w/flash 8 asset/xtra update) - Flash 8

            Excellent! Yes -multiple buttons (menu's) within individuals swf's

            Much better approach - as I am currently manually scripting individual
            events for each button - on(release)...

            Appreciate it!

            Michael


            "Rob Dillon - Adobe Community Expert" <rob@-remove-ddg-designs.com> wrote in
            message news:rob-4E8697.11115502122006@forums.macromedia.com...
            > What version of Director and what version of Flash are you working with?
            >
            > There is a Flash cursor behavior in the Director Library that will
            > handle the cursor change in Director, so you don't have to use getURL
            > for that part.
            >
            > What sort of action do you want to perform with these Flash buttons?
            > From you example it looks like you want some simple navigation control
            > in Director. Is each button a unique Flash .swf? Or do you have a number
            > of buttons in one Flash .swf? If each button is separate, then you could
            > just write a behavior as if the Flash sprite was any other button.
            >
            > If you have multiple buttons in any given .swf then you'll have to send
            > out a message from the .swf to initiate an action. There is a
            > mouseOverButton property for Flash members, but it can only tell if the
            > cursor is over a button, not a particular button.
            >
            > To give you flexibility and maybe simplify things, you could use a
            > getURL function in a behavior and set up a naming convention for your
            > Flash buttons. For instance, if you have four buttons in a Flash .swf,
            > name their instances sequentially, "one", "two", etc. then you can write
            > a simple actionscript function for the .swf:
            >
            > var buttonArray:Array = new Array(one,two,three,four);
            >
            > for (i in buttonArray) {
            > buttonArray .onRelease = function() {
            > getURL(this);
            > }
            > }
            >
            > this will send the name of the button instance that was clicked on to
            > the Director movie.
            >
            > Then you can just place a behavior like this on the Flash sprite:
            >
            > on getURL me,data
            > if data contains "one" then ....
            > end
            >
            > or use a case statement to parse out the string that was sent from the
            > Flash .swf.
            >
            > This might at least simplify the Flash development process.
            >
            > --
            > Rob
            > _______
            > Rob Dillon
            > Adobe Community Expert
            > http://www.ddg-designs.com
            > 412-243-9119
            >
            > http://www.macromedia.com/software/trial/



            • 3. Re: Flash sprites user response
              duckets Level 1
              Just a small note - Rob's code included a letter i inside sqaure brackets, which got interpreted as an italics marker in the forum, and so dissapeared from the code posted! The code should look like that attached below.

              - Ben


              • 4. Re: Flash sprites user response
                Level 7
                Thanks Ben!

                MH


                "duckets" <webforumsuser@macromedia.com> wrote in message
                news:el0tpg$lgr$1@forums.macromedia.com...
                > Just a small note - Rob's code included a letter i inside sqaure brackets,
                > which got interpreted as an italics marker in the forum, and so
                > dissapeared
                > from the code posted! The code should look like that attached below.
                >
                > - Ben
                >
                >
                >
                >
                > var buttonArray:Array = new Array(one,two,three,four);
                >
                > for (i in buttonArray) {
                > buttonArray .onRelease = function() {
                > getURL(this);
                > }
                > }
                >