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
E-mailExec 3 Pro
JTMR Image to Text
The Director Podcast
Send to Top
merge sorting including accent marked strings
StringLib
CPS Audio/MIDI Xtra
MediaPlayer Xtra
PrintF in Lingo
HEINEGUN
 

 

 

Behavior Wait for DirectMedia Xtra Sprite v. 2.0

Added on 3/20/2002

 

Compatibilities:
behavior D8 D8_5

Required Xtras:
DirectMedia Xtra 2

This item has not yet been rated

Author: tushonline (website)

Wait for DirectMediaXtra Sprite to finish Playing this is Similar to the Cue-Points in Tempo channel but this Behavior allows your RollOver Members to Work Correctly Just drag this behavior on to a Frame Script Channel, This Behavior works on ExitFrame Handler, Also you can choose CuePointTimes to wait for... ----------------------------------------------------------- PLEASE READ THE COMMENTS PART OF THE BEHAVIOR BEFORE YOU USE THE SCRIPT. --------------------------------------------------------- Download the Zip File. ----------------------------------------------------------- (''·.¸Tushar ¸.·'´)

Download PC Source
---Wait for DirectMediaXtra Sprite to finish Playing
----this is Similar to the Cue-Points in Tempo channel but this
-----Behavior allows your RollOver Members to Work Correctly
-------written on Feb. 21st 2002 12.55 pm IST. by Tushar
---------Modified March 19th 2002 13.30pm IST. by Tushar
----------Added - choosing a Cue-point Times directly to choose for Duration
----------Choose a Cue-point will show up the Cue-pointTimes
-----------[tushonline@hotmail.com]
-------------www.run4Fx.com
--------------In case of any suggestions forward this to run4fx@run4fx.com
---------------:::KNOWN::: Trying to let you choose any Sprite + change the cue-Times Dynamically
-------------------------------
---HOW TO USE THIS BEHAVIOR ---
-------------------------------

-- Just drag this behavior on to a Frame Script Channel
--- This Behavior works on ExitFrame Handler,
----- Check which is Your Sprite Number [pSprite] if you have something different
-------then change that value from this Sript [pSprite]
--------You can Choose Cue-points i.e. the times for Cue-points in the Sprite
-------- for which to wait or choose "Not Applicable"
---------to play thorugh for but make sure
---------the number of your Sprite for this which is aSprite or
----------the one u changed for aSprite marked with *****
-----------Select Marker to Jump after DirectMedia Xtra sprite finishes Playing or
------------Sprites CurrentTime reaches the Cue-point time you selected
------------- This Behavior Allows you to work your rollovers work properly
--------------I KNOW THERE ARE MANY DOUBTS IN YOUR MIND, DONT WORRY,
--------------- JUST WRITE ME A MAIL TUSHONLINE@HOTMAIL.COM OR RUN4FX@RUN4FX.COM

property pCue -- Optional Time in MilliSeconds for Cue
property pMarker -- Choose MArker to Jump After Cue
property pSprite -- DirectMedia Xtra Sprite Number

-- PropertyDescriptionList
on getPropertyDescriptionList me
  
  
  
  
  -- This is for getting Cue-point Names from Psprite
  tcues = []
  tCues.add("Not Applicable")
  
  mySprite = 1 --- Change this Value if your DirectMedia Sprite is Different. *****
  
  namelist =(sprite(mySprite).member.cuepointTimes)
  
  
  repeat with n = 1 to namelist.count
    thecues= nameList[n]
    tCues.add(thecues)
  end repeat
  
  
  
  
  
  -- This is for getting Markers
  markersList = GetMarkers (me)
  if markersList.count() = 2 then -- [[], []]
    ErrorAlert (me, #getPDL_DuplicateMarkers, markersList[2])
  end if
  tLabelList = []
  tLabelList.add("next")
  tLabelList.add("previous")
  
  repeat with i = 1 to count(the markerList)
    tLabelList.add((the markerList).getProp((the markerList).getPropAt(i)))    
  end repeat
  
  -- Property Description Box
  list = [:]
  addProp list, #pSprite, [#comment: "This must be your DirectMedia Sprite",
#format: #string,#default:"1"]
  addProp list, #pCue, [#comment: "Choose Cue-Points' time of your Sprite [Optional]",
#format: #String,#default:"Not Applicable",#range:tcues ]
  addProp list, #pMarker, [#comment: "Choose a Marker to Jump after this Cue",
#format: #Marker,#default:#getMarkers]
  
  return list
end









-- Error ALert for Duplis
On errorAlert(me)
  markersList = GetMarkers (me)
  if markersList.count() = 2 then Alert "Duplicate Markers found!!!"
  halt
end





--getting markers

on GetMarkers me -- as given in PropertyDescription
  localMarkerList = []
  duplicatesList = []
  markerString = the labelList
  delete the last char of markerString
  markerCount = the number of lines of markerString
  repeat with i = 1 to markerCount
    theMarker = markerString.line [i]
    if localMarkerList.getPos(theMarker) then
      -- Duplicate marker name
      if not duplicatesList.getPos(theMarker) then
        duplicatesList.append(theMarker)
      end if
    else
      localMarkerList.append(theMarker)
    end if
  end repeat
  if duplicatesList.count() then
    return [localMarkerList, duplicatesList]
  else
    return [localMarkerList]
  end if
end GetMarkers

-- Actual Event
on ExitFrame me
  if pCue = "Not Applicable" then
    if the currentTime of sprite (pSprite) < member(sprite(pSprite).member).duration then
      go to the frame
    else
      go (pMarker)
    end if
  else
    if pCue > 0 then
      if the currentTime of sprite (pSprite) < pCue then
      go to the frame
    else
      go (pMarker)
    end if
  end if
end if
end if

end

-- Defines, where to attach the Script [#FrameScript channel]
on isOKToAttach (me, aSpriteType, aSpriteNum)

tIsOK = 0  
if aSpriteType = #Script then
tIsOK = 1
end if  
return(tIsOK)  
end on

-- Behavior Description
on getBehaviorDescription me
return "Wait for DirectMediaXtra Sprite to finish Playing" & return & "this is Similar to the Cue-Points in Temp channel but this Behavior allows your RolLOver Members to Work Correctly" & return & "Just drag this behavior on to a Frame Script Channel" & return& "In case of any suggestions forward this to run4fx@run4fx.com"
end

-- Behavior ToolTip
on getBehaviorTooltip me
return "Wait for DirectMediaXtra Sprite to finish Playing" & return & "this is Similar to the Cue-Points in Temp channel but this Behavior allows your RolOver Members to Work Correctly" & return & "Just drag this behavior on to a Frame Script Channel"&return&"In case of any suggestions forward this to run4fx@run4fx.com"
end

 


Contact

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

Send e-mail