انواع xtra برای دایرکتور - کامل و رجیستر شده

سلام

تو برنامه دایرکتور تو بخش لایبرریش یک سری ( Behavior) وجود داره ؛ برای راحتی کاربر !

اما اکسترا هائی که استفاده میشه ، اونها هم یک سری Behavior دارن ظاهرا ً ، اما من پیداشون نمیکنم!

مثلاً تو این لینک ، از اکسترا استفاده شده و برای دکمه ها هم یک Behavior گذاشته شده با عنوان ِ

DirectMedia Xtra Controller Button

1248573925.jpg




کد:
http://forum.majidonline.com/showthread.php?t=36390&page=3
 

selxtra

New Member
با سلام
Direct Media Xtra دیگر از سوی سایت کمپانی ساپورت نمی شه به جاش از این اکسترا استفاده می شه
Mpeg Advance Xtra
که behavior هم دارد.
آخرین نسخه این اکسترا موجود است. http://selxtra.blogfa.com
با این حال اینم کد هایی که می خواستین
---- written for Director 8 ---
---- Kumar.K [email protected] ----
------ Custom Properties ------
property DirectmediaSprite,MyAction,WhereTo,thedirectmediaspritelist,StandardImage,RolloverImage,ClickedImage,firstparam,Secondparam,thirdparam
property spritenum

---- Get Behaviour Description List ------
on getBehaviorDescription me
return \
"This Behavior will control a DirectMedia Sprite " & RETURN & RETURN & \
"Parameters." & RETURN & \
"* DirectMedia Sprite" & RETURN & \
"* Action Like[Play,Pause,rewind] etc" & RETURN & \
"* First Parameter: if the Action is Seek than this parameter contains the seek to time (in milliseconds). For the PlaySegment action this parameter contains the starting time of the segment to play (in milliseconds)"& RETURN &"* Second Parameter: Used with the PlaySegment action. Contains the ending time of the segment to play (in milliseconds)" & RETURN & \
" * Third Parameter :Used With StepBackword/StepForward contains with how many frames it should step" & RETURN & \
"* Where To Assign this Script"
end getBehaviorDescription
---- Get Behaviour Description List ------

------ Get Behavior Description List ------
on getPropertyDescriptionList me
set description = [:]
thedirectmediaspritelist=searchDirectmediaSprites(me)
actionlist=["Play","Pause","Rewind","Seek","PlaySegment","StepBackward","StepForward"]
if the currentspritenum = 0 then
set memdefault = 0
else
set memref = the member of sprite the currentspritenum
set memdefault = member (the membernum of member memref + 1)
set memdefault2 = member (the membernum of member memref + 2)
end if
if thedirectmediaspritelist.count() > 0 then
SetaProp description, #DirectmediaSprite, [#comment:"Directmedia Sprite",#format:#integer,\
#range: thedirectmediaspritelist,#default: thedirectmediaspritelist[1]]
else
SetaProp description, #DirectmediaSprite, [#comment:"Wait for Which Directmedia Sprite",#format:#integer,\
#default: 1]
end if
SetaProp description, #MyAction, [#comment: "Action :", #format:#String, #range:actionlist,#default:actionlist[1]]
SetaProp description, #firstparam, [#comment: "First Parameter(Use With Seek or PlaySegment) :", #format:#Integer,#default:"enter value in miliseconds"]
SetaProp description, #Secondparam, [#comment: "Second Parameter(Use With PlaySegment) :", #format:#Integer,#default:"enter value in miliseconds"]
SetaProp description, #thirdparam, [#comment: "Step with How many Frames(Use With StepForward/StepBackward) :",format:#Integer,\
#range:[#min:1,#max:500],#default:50]
SetaProp description, #RolloverImage, [#comment: "Rollover Image :",format:#Graphic,#default:memdefault]
SetaProp description, #ClickedImage, [#comment: "Clicked Image :",format:#Graphic,#default:memdefault2]
if the currentspritenum = 0 then
SetaProp description, #WhereTo, [#comment: "Where To Attach" ,#format:#String, \
#range:["On EnterFrame","On ExitFrame"],#default:"On EnterFrame"]
else
SetaProp description, #WhereTo, [#comment: "Where To Attach" ,#format:#String, \
#range:["On MouseUp","On MouseDown","On MouseEnter","On MouseLeave"],#default:"On MouseUp"]
end if
return description
end getPropertyDescriptionList
------ Get Behavior Description List ------

---- Can be attached both frame script and sprite script ------
on isOKToAttach (me, aSpriteType, aSpriteNum)
case aSpriteType of
#script:
return true
#graphic:
return true
end case
end isOKToAttach
---- Can be attached both frame script and sprite 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 ------

-- Events --
on beginsprite me
set standardImage = the member of sprite the spriteNum of me
end

on EnterFrame me
if WhereTo = "On EnterFrame" then
controlit
end if
end EnterFrame

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

on MouseUp
set the member of sprite spritenum = StandardImage
if WhereTo = "On MouseUp" then
controlit
end if
end MouseUp

on MouseDown
set the member of sprite spritenum = ClickedImage
if WhereTo = "On MouseDown" then
controlit
end if
end MouseDown

on MouseEnter
set the member of sprite spritenum = RolloverImage
if WhereTo = "On MouseEnter" then
controlit
end if
end MouseEnter

on MouseLeave
set the member of sprite spritenum = StandardImage
if WhereTo = "On MouseLeave" then
controlit
end if
end MouseLeave
-- Events --

--- Control DirectMedia Sprite --
on controlit
if member (sprite(DirectmediaSprite).member).type = #TBDIRECTMEDIA then
case MyAction of:
"Play": videoplay(sprite DirectmediaSprite)
"Pause": videopause(sprite DirectmediaSprite)
"Rewind": videoseek(sprite DirectmediaSprite, the segmentstart of sprite DirectmediaSprite)
videoplay(sprite DirectmediaSprite)
"Seek":videoseek(sprite DirectmediaSprite, firstparam)
videoplay(sprite DirectmediaSprite)
"PlaySegment":videoplaysegment(sprite DirectmediaSprite, firstparam, secondparam)
"StepForward":videopause(sprite DirectmediaSprite)
videoseek(sprite DirectmediaSprite, the currenttime of sprite DirectmediaSprite + thirdparam)
videoplay(sprite DirectmediaSprite)
"StepBackward":videopause(sprite DirectmediaSprite)
videoseek(sprite DirectmediaSprite, the currenttime of sprite DirectmediaSprite - thirdparam)
videoplay(sprite DirectmediaSprite)
end case
end if
end
--- Control DirectMedia Sprite --​
 
سلام

همش این خطا رو میده ! من دکمه هامو گذاشتم ، براشون نام هم گذاشتم ، ولی بازم این پیغام خطا رو میده !

چرا؟ تو صفحه ی اول اون لینکی که دادم هم توضیح داده بود ؛ کدها رو تو یه اسکریپت بریزم و بعد روی دکمه هام

بکشم و با کشیدن روی دکمه ها یه کارد باز میشه و میگه این دکمه چه عملی رو انجام بده ؟ !!!

ولی این پنجره اصلاً ظاهر نمیشه !!!

1248724902.jpg

 
سلام

فقط از این دو خط قرمز رنگ ایراد میگیره ، آیا تنظیمات خاصی لازمه ؟ !


کد:
on getPropertyDescriptionList
   if the currentspritenum = 0 then 
     set memdefault = 0 
   else
     set memref = the member of sprite the currentspritenum
     set castlibnum = the castlibnum of memref
     [COLOR=Red][B]set memdefault = member (the membernum of member memref + 1) of castlib castlibnum
      set memdefault2 = member (the membernum of member memref + 2) of castlib castlibnum[/B][/COLOR]
   end if
   
  set p_list = [   #videoCommand: [ #comment:   "Action:",#format:   #symbol,   #range: [ #Play, #Pause, #Rewind,#StepBackward,#StepForward, #Seek, #PlaySegment],#default:   #Play ], #param1: [ #comment:   "First Parameter (Use with seek or playsegment):", #format:   #long, #default:    0] , #param2: [ #comment:   "Second Parameter (Use with playsegment):", #format: #long,   #default:    0] ,  #videoSprite: [ #comment:   "DirectMedia Sprite Channel:", #format:   #integer,   #default:    1] ,    #alternateImage: [ #comment:   "Rollover Button Cast Member:",                     #format:   #graphic,                    #default:    memdefault ], #clickedImage: [ #comment:   "Clicked Button Cast Member:",                     #format:   #graphic,                    #default:    memdefault2 ]]                  
   return p_list
 end
 
 on getBehaviorDescription
   return "Used to create Play, Pause, StepForward, StepBackward, Rewind, Seek and PlaySegment control buttons for a DirectMedia Xtra video sprite. You can also attach rollover and alternate images for the clicked buttons" & RETURN & "PARAMETERS:" & RETURN & "Action - Choose the action to perform on mouseUP ( Play, Pause, Rewind, StepBackward, StepForward, Seek, PlaySegment )." & RETURN & "First Parameter: if the Action is Seek than this parameter contains the seek to time (in milliseconds). For the PlaySegment action this parameter contains the starting time of the segment to play (in milliseconds)"& RETURN &"Second Parameter: Used with the PlaySegment action. Contains the ending time of the segment to play (in milliseconds)"& RETURN &"DirectMedia Sprite Channel - Enter the number of sprite channel of the DirectMedia Xtra video that is being controlled."& RETURN &"Rollover Button: the castmember that will be used as the rollover image of the button. Default is the castmember located just after the button castmember"& RETURN&"Clicked Button: the castmember that will be used as the clicked image of the button. Default is the castmember located just after the rollover castmember"
 end
 
آخرین ویرایش:

جدیدترین ارسال ها

بالا