6 Replies Latest reply on May 2, 2007 8:11 PM by Chunick

    I Beam HELP NEEDED!

    korkster911 Level 1
      Hello,

      I'm in desparate need of some help. I have a flash input text field that is embedded in Director as a flash sprite. I'm using the most recent build of Director which apparently fixes the "Know I Beam" issue and it does seem to work...

      BUT,

      My projector does a little bit more. At the very beginning I run the following script.

      on prepareMovie me
      screenWidth = baScreenInfo("width")
      screenHeight = baScreenInfo("height")
      stageHeight = screenHeight
      stageWidth = screenHeight * 1.25
      stageCentreWidth = (screenWidth - stageWidth) / 2
      _movie.stage.rect = rect(stageCentreWidth, 0, screenWidth - stageCentreWidth, stageHeight)
      end

      All this code does is sets up the screen to scale to fullscreen at a 3:4 aspect ratio. Once this is accomplished, there is a behavior that scales the Flash sprites in the frame to the appropriate size. So what happens?

      Well, on my Desktop 1600X1200 screen resolution... I can see the I Beam in the input text field... but my laptop which is 1280X720 It does not exist... If I set my desktop to 1280X1024, the can still see the I Beam. The client requires the I Beam and this is only an issue when the Director stage has been scaled and only on machines other than the development system? I've even tried using Verdana as the font but to no avail.

      Everything in my projector works perfectly except for the I Beam disappearing???

      Please help? I'm at a loss on this one!
        • 1. I Beam HELP NEEDED!
          Chunick Level 3
          1) create an I-beam graphic using an image, vectorShape or anything that can have it's registration point changed.
          2) edit the member in Director's paint or vectorshape (or other) window or use code to change the registration point of the member to the bottom of the member (instead of the center as in bitmap images and vectorshapes, for example).
          3) You may consider creating a gif or filmloop of the I-beam to get the animated blinking effect as well as setting it's sprite ink to reverse.
          4) Create a behviour script member and paste the code below into it and then attach the behavior to your I-beam sprite.

          property spriteNum, sp, mem
          property pOffPos

          on beginSprite me
          sp = sprite(spriteNum)
          mem = sp.member
          pOffPos = point(the stage.rect.width + 10, the stage.rect.height + 10)
          sp.loc = pOffPos
          end

          on prepareFrame me
          spNum = the keyBoardFocusSprite
          if spNum > 0 then
          txtSp = sprite(spNum)
          sp.locZ = sprite(spNum).locZ
          txtMem = txtSp.member
          sel = txtMem.selection
          if sel[1] = sel[2] then
          selPoint = txtMem.charPosToLoc(sel[1] + 1) - point(0, txtMem.scrollTop)
          if selPoint.locV < 0 or selPoint.locV > txtSp.height then
          sp.loc = pOffPos
          exit
          end if
          if selPoint.locH > txtSp.width then selPoint.locH = txtSp.width
          ibeamPoint = txtSp.mapMemberToStage(selPoint)
          sp.height = getDefaultFixedLineSpace(txtMem, max(1,sel[1]))
          sp.loc = ibeamPoint
          else
          sp.loc = pOffPos
          end if
          else
          sp.loc = pOffPos
          end if
          end

          on getDefaultFixedLineSpace (theMem, theChar)
          theRef = theMem.char[theChar].ref
          theField = new(#field)
          theField.text = theRef.text & RETURN
          theField.font = theRef.font
          theField.fontSize = theRef.fontSize
          theLineHeight = theField.lineHeight - 1
          theField.erase()
          return theLineHeight
          end

          ** Note: the above code will function reasonably well, but there are some things that haven't been taken into consideration:
          1) if a line gets cut off at the top or bottom then the I-beam height won't adjust to accommodate that.
          2) setting no wrap on the text member has it's own inherent issues, but the I-beam will work with it just not absolutely perfect.
          3) you may need to add some modifiers or adjustments to the positioning of the I-beam to fine tune it if you can't or don't set the member's registration point to the bottom (left, center or right horizontal registration is you own choice).
          • 2. Re: I Beam HELP NEEDED!
            korkster911 Level 1
            Hmmm... I'm not sure that this will work Chunick? The Flash sprite consists of many buttons and text elements and "one" of those elements is a flash input box? So for example, I have 10 buttons that say "go to a section" but below is a "search box". All are contained within a single Flash sprite.


            • 3. Re: I Beam HELP NEEDED!
              korkster911 Level 1
              I'm growing increasingly frustrated... For some reason, the I Beam appears on my development system at all tested resolutions from 800X600 all the way up to 1600X1200. It works fine.

              On every single other machine I test it on, the flashing I Beam sinply doesn't exist. I've also tried the textInput component in Flash with the EXACT SAME results.

              Any other ideas?
              • 4. Re: I Beam HELP NEEDED!
                Level 7
                I just checked, and there are a couple of cursor xtras in the Xtras/Media
                Support folder. Just for kicks you might want to verify they're getting
                included along with your build.

                TR

                "korkster911" <webforumsuser@macromedia.com> wrote in message
                news:f1baoe$ov8$1@forums.macromedia.com...
                > I'm growing increasingly frustrated... For some reason, the I Beam
                > appears
                > on my development system at all tested resolutions from 800X600 all the
                > way up
                > to 1600X1200. It works fine.
                >
                > On every single other machine I test it on, the flashing I Beam sinply
                > doesn't exist. I've also tried the textInput component in Flash with the
                > EXACT
                > SAME results.
                >
                > Any other ideas?
                >


                • 5. Re: I Beam HELP NEEDED!
                  Level 7
                  on 2nd thought, that might not have anything to do with it if it's a flash
                  text field.


                  • 6. Re: I Beam HELP NEEDED!
                    Chunick Level 3
                    ... for some reason I completely missed the whole "flash input text field" part"... I thought this was just a regular Director text member. Anyways, good luck with getting the flash cursor to show.