Multimédiás programok készítése Macromedia Director fejlesztői környezetben 4. előadás Készítette: Kosztyán Zsolt
Hangkezelés II Hangerő –volume (cast member property) member("SWAfile").volume = 128 –volume (sound channel) sound(2).volume = 130 –volume (sprite property) sprite(7).volume = 256
Hang-, Videó-kezelés II Média lekérdezése on checkForText if member("Today's News").trackType(5) = #text then textFormat end –#video, #sound, #text és #music
Hang-, Videó-kezelés II Track-ek kezelése –Track-ek száma trn=member("Jazz Chronicle").trackCount() trn2=sprite(10).trackCount() –Navigáció sprite(whichDigitalVideoSprite).trackNextKeyTime( whichTrack) sprite(whichDigitalVideoSprite). trackNextSampleTime(whichTrack)
„”File-kezelés I n. file elérése n = getNthFileNameInFolder(the moviePath, i) File IO Xtra használata fileIOInstance = xtra("FileIO").new() if not fileIOInstance.objectP then alert "File IO Xtra hiányzik" exit end if
File-kezelés I File megnyitása/beolvasása global myFile on mouseUp if objectP(myFile) then set myFile = 0 myFile = new(xtra "fileio") openFile(myFile,the moviePath&"info.txt",1) myVariable = readFile(myFile) if readFile(myFile)=VOID then alert "File elérési hiba" else member("input").text = myVariable closeFile(myFile) end if myFile = 0 end
File-kezelés I File mentése global myFile on mouseUp if objectP(myFile) then set myFile = 0 myFile = new(xtra "fileio") openFile (myFile, the moviePath &"info.txt",0) delete(myFile) createFile (myFile, the moviePath &"info.txt") openFile(myFile,the moviePath &"info.txt",0) mySaveString = member("input").text writeString(myFile,mySaveString) closeFile(myFile) myFile = 0 end
File-kezelés I File hozzáfűzése global myFile on mouseUp if objectP(myFile) then set myFile = 0 mySaveString = " "&the text of field "input" myFile = new(xtra "fileio") openFile(myfile, the moviePath&"info.txt",0) setPosition(myfile,getLength(myFile)) writeString(myFile, mySaveString) closeFile (myfile) myFile = 0 end
Alkalmazások elérése Futtatható programok elérése open ”parameter” with ”filename.exe” Director Movie file-ok elérésée interneten keresztül gotoNetMovie " /buttons.dcr#Contents"
Filekezelés II –Néhány szerver oldali file- hozzáférési parancs: readValue(), writeValue(), exists, locked, read(), write(), delete(), rename(), exchange(), copyTo(), getAt(), createFolder(), deleteFolder(), open(), flush(), close(), size, position
Filekezelés II –ReadValue tempImage = file("HardDrive:\Images\Sunset.tmp").readValue() –WriteValue file("HardDrive:\Images\Tempimage. tmp").writeValue(theImage)
Filekezelés II –Exists if file("C:\Images\Moon.bmp").exists then put "Moon.bmp is present" else put "Moon.bmp is not present" end if
Filekezelés II –Locked file("C:\Text_files\LongSpeech.txt"). locked = TRUE –Read tempText = file("HardDrive:\TextFiles\ Longspeech.txt").read(255)
Filekezelés II –Write file("HardDrive:\Shortspeech.txt"). write("This is some new text") –Delete file("C:\Images\sunset.jpg").delete()
Internet kliens/szerver alkalmazások (Multiuser) – Filekezelés II –Rename file("HardDrive:\Images\Sunset.bmp ").rename("Horizon.bmp") –Exchange file("C:\Images\Sunset.jpg"). exchange("C:\Images\Sunrise.jpg")
Internet kliens/szerver alkalmazások (Multiuser) – Filekezelés II –CopyTo file("C:\Longspeech.txt").copyTo(C:\ Shortspeech.txt") –GetAt put string( file.("C:\Images").getAt(3) ) -- "[#name: "Sunset.jpg", #folder: 0, #visible: 1]"
Internet kliens/szerver alkalmazások (Multiuser) – Filekezelés II –CreateFolder file("C:\Multiuser_Server\ Tempfolder").createFolder() –DeleteFolder file("C:\Images").deleteFolder() –FolderChar theChar = file().folderChar
Internet kliens/szerver alkalmazások (Multiuser) – Filekezelés II –Open file("C:\Text_files\LongSpeech.txt"). open([#read: 1, #write: 1, \ #create: 0]) –Flush file("C:\Multiuser_Server\Testfile.txt).flush()
Internet kliens/szerver alkalmazások (Multiuser) – Filekezelés II –Close file("C:\Longspeech.txt").close() –Size fileSize = file( “ C:\Images\Sunset.bmp").size –Position file("C:\Text_files\Longspeech.txt"). position = 445