Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Copy My Text
Play/Pause/Stop SWA(Shockwave Audio)
Font Freak
Set Up Users Components
Set Cast member Properties of a QuickVrMovie
Font Dialog Behavior
cXtraPrinterDoc
Select It
change LocZ
Move Window [ stage or MIAW ]
MediaMacros Xtras Mall
 

 

 

Behavior ZGTSB-TextInteractivity

Added on 5/22/2001

 

Compatibilities:
behavior D8 D8_5 Mac PC Shockwave

This item has not yet been rated

Author: Ziggi

This applies to the text or field sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and brings text interactivity by line.

Download PC Source    Download Mac Source
-- ZIGGI GENERIC TEXT SCROLLING BEHAVIOURS --
-- (C) 2001 Zbigniew Szczesny

property pMeForeColor, pMeAltForeColor, pMouseLineNum, pMeLastLine, pLineClicked, pMeMemberNum, pMeCastLibNum, pMeSpriteNum, pMeType, pMeLineCount

on getBehaviorDescription
  return "This applies to the text or field sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and brings text interactivity by line."
end

on isOKtoAttach me, spriteType, spriteNum
  case spriteType of
    #graphic:
      meType = sprite(spriteNum).member.type
      return meType = #text or meType = #field
    #script:
      return FALSE
  end case
end

on beginSprite me
  pMeSpriteNum = me.spriteNum
  pMeMemberNum = sprite(pMeSpriteNum).memberNum
  pMeCastLibNum = sprite(pMeSpriteNum).castLibNum
  pMeLastLine = 0
  pMeForeColor = member(pMeMemberNum, pMeCastLibNum).foreColor
  pMeAltForeColor = 1 -- here enter the colour number of highlited text in text (not field !) member
  pMeLineCount = member(pMeMemberNum, pMeCastLibNum).line.count
  pMeType = member(pMeMemberNum, pMeCastLibNum).type
end

on mouseWithin me
  if me.pMeType = #text then
    pMouseLineNum = pointToLine(sprite(pMeSpriteNum), the mouseLoc)
    member(pMeMemberNum, pMeCastLibNum).line[pMouseLineNum].foreColor = pMeAltForeColor
    if pMeLastLine <> 0 and pMeLastLine <> pMouseLineNum then
      member(pMeMemberNum, pMeCastLibNum).line[pMeLastLine].foreColor = pMeForeColor
    end if
    pMeLastLine = pMouseLineNum
  else
    pMouseLineNum = the mouseLine
    member(pMeMemberNum, pMeCastLibNum).line[pMouseLineNum].hilite()
  end if
end

on mouseLeave me
  if me.pMeType = #text then
    member(pMeMemberNum, pMeCastLibNum).foreColor = pMeForeColor
    pMeLastLine = 0
  else
    member(pMeMemberNum, pMeCastLibNum).line[pMeLineCount + 1].hilite()
  end if
end

on mouseUp me
  pLineClicked = pMouseLineNum
  -- Here you can enter your code handling onMouseUp event,
  -- or you can call pLineClicked property of this sprite to get the clicked line number.
  put member("ZGTSB-SampleTargetList").line[pLineClicked] -- this is an example.
end  

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail