1 Reply Latest reply on Sep 3, 2006 7:37 AM by Newsgroup_User

    Flash and Lingo

    Level 7
      Hello:

      I have a buton in Flash that I need to import in Director.
      The function of this button is scroll a Director textbox on this way:

      On MouseDown me
      repeat while Stilldown
      --scroll text
      end repeat
      end

      What code do I have to put in Flash, to run my MouseDown in Director?

      Thank you


        • 1. Re: Flash and Lingo
          Level 7
          Hi Anne,

          Actually, you can just apply that behavior to the Flash sprite and it
          will work. However the mouse event will apply to the whole sprite, so if
          you set the direct to stage of the Flash member to false and then set
          the ink of the Flash sprite to matte, only the actual button will show
          and only the button will receive the mouse event.

          If you want to place actionscript in your Flash movie that will trigger
          something in DIrector then you will need to call a Director function
          from the Flash movie. It might look something like this.

          in Flash:

          buttonInstanceName.onPress = function() {
          getURL("event:startScroll");
          }

          buttonInstanceName.onRelease = buttonInstanceName.onReleaseOutside =
          function() {
          getURL("event:stopScroll");
          }

          You don't really want to be sending a continuous message to the Director
          movie from the Flash movie.

          Then in the Director movie, place a behavior on the Flash sprite like
          this:

          property thisSprite
          property textSprite
          property OKtoScroll
          property maxScroll

          on getPropertyDescriptionList
          myPropList = [:]
          myPropList.addProp(#textSprite,[#comment:"enter the sprite channel
          number of the text sprite to be scrolled:",#format:#integer,#default:""])
          return myPropList
          end

          on beginSprite me
          thisSprite = me.spriteNum
          OKtoScroll = false
          sprite(textSprite).member.scrollTop = 0
          maxScroll = sprite(textSprite).member.height -
          sprite(textSprite).height
          end

          on startScroll me
          OKtoScroll = true
          end

          on stopScroll me
          OKtoScroll = false
          end

          on exitFrame me
          if OKtoScroll then
          if sprite(textSprite).member.scrollTop < maxScroll then
          sprite(textSprite).member.scrollByLine(1)
          end if
          end if
          end

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

          http://www.macromedia.com/software/trial/