Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Sub Hunt
To activate previous instance and quit
CD-ROM Drive Letter Finder-Using a File
Hold on a frame till sound finishes playing
Billenium Transitions Xtra v1.3
Buddy Tray
Expire date
Tools for fulltext searching in Director and Authorware
Toggle DirectToStage Property of a Flash Sprite
Vector Shape - Create Sine Wave
 

 

 

Behavior Font Size DropDown

Added on 11/29/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

Rating:

Author: HasanKazmi (website)

Change font size with a drop down menu.

Download PC Source    Download Mac Source
--786
--Behaviour: Drop down box for changing Font Size
--By: Hasan Yasar Kazmi
-- Hamdard University Islamabad Pakistan
-- dir@37.com
--20/11/2000
--Instructions:
--Attach with any Field Sprite, it will be turned into a change font drop down box
-- The Initial title of the Drop down can be adjusted from the Behaviour Inspector

--Code
property spritenum,TextspriteNum,Title,FontSizeList

on getPropertyDescriptionList
  set description = [:]
  addProp description, #TextSpriteNum, [#default: 1,#format:#integer, #comment: "Field/Text Sprite Num To change Font:"]
  addProp description, #Title, [#default:"Font Size",#format:#string, #comment: "Title Of Drop Down Box:"]
  return description
end
on getBehaviorDescription---Behaviour Discription
  return "Dropdown Box for Changing Font Size"
end

on beginsprite me  
   FontSizeList = [6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,40,42,46,50,54,58,64,68,72,78,96]
  spritenum = sprite(the spritenum of me)
  sprite(spritenum).member.boxType = #Adjust
  sprite(spritenum).member.text = string(title)
  updatestage
end beginsprite me

on MouseEnter me  
  repeat with i = 1 to FontSizeList.count    
    Val = getAt(FontSizeList,i)    
    sprite(spritenum).member.line[i] =Val
  end repeat  
  updatestage
end  MouseEnter me

on Mousewithin me  
  sprite(spritenum).member.line[the mouseline].Hilite()
  updatestage  
end Mousewithin me

On mouseup me
  sprite(TextspriteNum).member.fontsize = value(sprite(spritenum).member.line[the mouseline])
  sprite(spritenum).member.text = string(title)
  updatestage
end mouseup me

on MouseLeave me  
  sprite(spritenum).member.text = string(title)
  updatestage  
end MouseLeave me

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail