Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Sprite Blender - Time
Prime Number Xtra
JTMR KoolMarquee
Set ImageEnabled Property of a Flash Sprite
Clear all editable fields
write/append to text file
Select All Behavior (Ctrl + A)
Ceiling and Floor
Get VideoForWindows Version
Volume Slider
MediaMacros Xtras Mall
 

 

 

Behavior Font Style Change

Added on 5/26/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: MediaMacros (website)

This behavior will change the font style fo selected characters in an editable field. Call using sendSprite or sendAllSprites and the fontstyle to toggle.. sendSPrite(1, #toggleStyle, #bold)

--Copyright 2000 Chuck Neal
--chuck@mediamacros.com
--If you find this code helpful, send me an e-mail and let me know. :-)


property spriteNum

on toggleStyle me, whatStyle
  theSelect = sprite(spriteNum).member.selection
  --fix if the selection sstarts with 0
  if theSelect[1] = 0 then
    if theSelect[2] <= 0 then
      exit
    else
      theSelect[1] = 1
    end if
  end if
  if theSelect[1] = theSelect[2] then
    --nothing selected
    exit
  end if
  currentStyle = sprite(spriteNum).member.char[(theSelect[1] + 1)..theSelect[2]].fontstyle
  if currentStyle.getOne(#plain) <> 0 then
    currentStyle = []
  end if
  if whatStyle = #plain then
    currentStyle = [#plain]
  else
    if currentStyle.getOne(whatStyle) <> 0 then
      --already there, remove it
      currentStyle.deleteOne(whatStyle)
    else
      currentStyle.add(whatStyle)
    end if
  end if
  sprite(spriteNum).member.char[(theSelect[1] + 1)..theSelect[2]].fontstyle = currentStyle
end

on getBehaviorDescription me
  describe = "Drop this on an editable text sprite to allow toggling of #bold, #italic, #plain, and #underline."
  describe = describe & return & "Call like this..." & return & "sendSprite(1, #toggleStyle, #bold)"
  return describe
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