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
Vector Shape - Create Grid
3D games online. New cosmic world of Tensoric.
File Open Dialog Behavior
Flash Development
Bouncing Ball
Go to Different Movie
PowerPoint / PPT Access
Imaging Lingo Basics
DirectOS Xtra
DirectInteraction Xtra.
 

 

 

Behavior Hold Till Flash Directmedia finishes playing

Added on 6/12/2000

 

Compatibilities:
behavior D7 D8 PC

This item has not yet been rated

Author: KumarK

Hold Till Flash Directmedia finishes playing

---- written for Director 8 ---
---- Kumar.K kumark@icode.com ----
------ Custom Properties ------
property  DirectmediaSprite,MyAction


------ Events ------
on prepareframe
  if the loop of member (sprite(DirectmediaSprite).member) = true then
    set the loop of member (sprite(DirectmediaSprite).member) to false
  end if
end

on ExitFrame me
  if member (sprite(DirectmediaSprite).member).type = #TBDIRECTMEDIA then
    if the currenttime of sprite(DirectmediaSprite) < the duration of member sprite(DirectmediaSprite).member then
      go the frame
    else
      case(MyAction) of
        "Go to NextFrame": Go the Frame+1
        "Go to Next Marker": Go Next
        "Go Previous Marker": Go previous
        "Go Loop": Go Loop
        "Quit": quit
      end case
    end if
  end if
end ExitFrame
------ Events ------

------ Get Behaviour Description List ------
on getBehaviorDescription me
  return
  "This Behavior will hold on the frame till the specified DirectMedia Sprite " & RETURN &
  "Finishes Playing." & RETURN & RETURN &
  "Parameters." & RETURN &
  "*  DirectMedia Sprite" & RETURN &
  "*  Action(go NextFrame or Go NextMarkeror Go Previous Marker or Go Loop or Quit)"
end getBehaviorDescription
------ Get Behaviour Description List ------

------ Get Behavior Description List ------
on getPropertyDescriptionList me
  if the currentspritenum <> 0 then exit
  thedirectmediaspritelist = searchDirectmediaSprites(me)
  propslist=[:]  
  if thedirectmediaspritelist.count() > 0 then
    SetaProp propslist, #DirectmediaSprite, [#comment:"Wait for Which Directmedia Sprite",#format:#integer,
  #range: thedirectmediaspritelist,#default: thedirectmediaspritelist[1]]
  else
    SetaProp propslist, #DirectmediaSprite, [#comment:"Wait for Which Directmedia Sprite",#format:#integer,
  #default: 1]
  end if  
    SetaProp propslist, #MyAction, [#comment: "What Next?" ,#format:#String,
#range:["Go to NextFrame","Go to Next Marker","Go Previous Marker","Go Loop","Quit" ],#default:"Go to NextFrame"]
    return propslist
end getPropertyDescriptionList
------ Get Behavior Description List ------

------ Can be attached to only Frame script ------
on isOKToAttach (me, aSpriteType, aSpriteNum)
    case aSpriteType of
      #script:
        return true
    end case
  end if
end isOKToAttach
------ Can be attached to only Frame script ------

------ Search for DirectMedia Member on the Stage ------
on searchDirectmediaSprites me
  set thedirectmediaspritelist = []
  repeat with i=1 to the lastchannel
    if sprite(i).member.type = #TBDIRECTMEDIA then
      thedirectmediaspritelist.append(i)
    end if
  end repeat
  return thedirectmediaspritelist
end
------ Search for DirectMedia Member on the Stage ------  

 


Contact

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

Send e-mail