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
NightWares
Library for the control of volume in Director
Iconizer
UpDown Timer
Screen grab to castmember
Domicilia
A* Pathfinder in Lingo
Postscript to Vector Converter
Check for DirectShow Installation
V12 Database Engine
 

 

 

Behavior Flash Member Controls

Added on 5/24/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: KumarK

Controls a Flash member with play, pause, fast forward, rewind, etc.

------ Custom Properties ------
property  FlashSprite,MyAction,WhereTo

------ Events ------
on EnterFrame me
  if WhereTo = "On EnterFrame" then
    DoAction
  end if
end EnterFrame

on ExitFrame me
  if WhereTo = "On EnterFrame" then
    DoAction
  end if
end ExitFrame

on MouseUp
  if WhereTo = "On MouseUp" then
    DoAction
  end if
end MouseUp

on MouseDown
  if WhereTo = "On MouseDown" then
    DoAction
  end if
end MouseDown

on MouseEnter
  if WhereTo = "On MouseEnter" then
    DoAction
  end if
end MouseEnter

on MouseLeave
  if WhereTo = "On MouseLeave" then
    DoAction
  end if
end MouseLeave
------ Events ------

------ Get Behavior Description List ------
on getPropertyDescriptionList me
  flashmememberlist = searchflashsprite(me)
  if flashmememberlist.count() < 0 then exit
  propslist=[:]
  SetaProp propslist, #FlashSprite, [#comment:"Flash Sprite",#format:#integer, #range: flashmememberlist,#default: flashmememberlist[1]]
  SetaProp propslist, #MyAction, [#comment: "Action", #format:#String,#range:["Play","Pause","Stop","Rewind"], #default:"Play"]
  if the currentspritenum = 0 then
    SetaProp propslist, #WhereTo, [#comment: "Where To Attach",#format:#String, #range:["On EnterFrame","On ExitFrame"],#default:"On EnterFrame"]
  else
    SetaProp propslist, #WhereTo, [#comment: "Where To Attach",#format:#String, #range:["On MouseUp","On MouseDown","On MouseEnter","On MouseLeave"],#default:"On MouseUp"]
  end if
  return propslist
end getPropertyDescriptionList
------ Get Behavior Description List ------

------ Check Whether Flash Member Availabale on the Stage------

on isOKToAttach (me, aSpriteType, aSpriteNum)
  flashmememberlist = searchflashsprite(me)
  if flashmememberlist.count() > 0 then
    case aSpriteType of
      #graphic:
        return true
      #script:
        return true
    end case
  end if
end isOKToAttach
------ Check Whether Flash Member Availabale on the Stage------        

------ Search for Flash Member on the Stage ------
on searchflashsprite me
  set theflashmemlist = []
  repeat with i=1 to the lastchannel
    if sprite(i).member.type = #flash then
      theflashmemlist.append(i)
    end if
  end repeat
  return theflashmemlist
end
------ Search for Flash Member on the Stage ------

------ Custom Function to Perform the Action ------
on DoAction
  Case (MyAction) of
    "Play":
      Sprite(Flashsprite).Play()
    "Pause":
      Sprite(Flashsprite).Hold()
    "Stop":
      Sprite(Flashsprite).Stop()
    "Rewind":
      Sprite(Flashsprite).Rewind()
      Sprite(flashsprite).Play()
  End Case
end
------ Custom Function to Perform the Action ------

 


Contact

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

Send e-mail