need your help with cuepoints!
by Munira Begmuratova
on
Feb 26, 2009 at 5:42:09 am
Hi there!
I have a problem, I have to add subtitles to video, though I am new to adobe director and the project is done by another person... It is a cd project in three languages, for one language we have subtitles, but I could not get how developer has done it. There is a video imported as mpeg advance xtra. Cuepoints are added to that video. There are also png files with text in library which have the same names as those cuepoints, and when, for example, video plays in english, subtitles appear there, if in russian, there are no subtitles, and if in third language there are also no subtitles, and I have to fix this problem... To make it more clear here is a piece of code about those cuepoints:
global glang
on cuePassed me, cuePointName1, cuePointName2, cuePointName
sprite(56).member = cuePointName
end
on ExitFrame me
if glang = "eng" then
sprite(56).visible = true
else
sprite(56).visible = false
end if
end
The difficult part for me is to understand how the sprite number 56, which holds subtitles, is connected with the sprite which holds video. How this sprite references those images to appear on the stage, and why this sprite does not reference any cast member (in property inspector in member tab next to member there is sth like this "---") and it does not have any behaviors...
I wish someone could suggest me a way out...
I would really appreciate any help!
Thanks in advance!
Re: need your help with cuepoints! by Brodd Nesset on Feb 27, 2009 at 9:13:08 am
This can't be all the code you have in this project.
The part that is posted suggests a typical Director 'hackish' approach that actually works well, but isn't very professional and expandable when that day comes.
You need to set the global glang (for choice of language) somewhere. Perhaps / probably when you start the movie. glang should be for instance "_rus" for russioan and "_ita" for italian and so on. The default could be "" - an empty string. Note that this is not an empty variable, which would throw an error.
As you probably have guessed you need to create new cast members for the subtitles in every language. Oh dear. If for instance the excisting cast member sequence is named "cp1", "cp2" and so on, you should make similar sequences named "cp1_rus", "cp2_rus" and "cp1_ita", "cp2_ita". To change language in the subtitles, i.e. load a different set of cast members, you need to combine the name of the cuepoint with the content of the glang variable. Since both are strings (cuepoints are by default strings - what else?) it's a simple
sprite(56).member = cuePointName & glang If glang = "" the script will behave exactly as before, and load the default cast members.
If would modify the ExitFrame handler for clarity:
on exitFrame me
global glang
if glang = "nosubtitle" then
sprite(56).visible = false
else
sprite(56).visible = true
end if
end
This will allow you to change language for subtitles underway, even.
Personally I'd aim to use one Text member and a formatted document with all the subtitling in one place, for easy revision. That's some different scripting.
Her lips said "no!" but her eyes said "read my lips".
Re: need your help with cuepoints! by Brodd Nesset on Feb 27, 2009 at 10:08:43 am
Quote from my previous post: "Personally I'd aim to use one Text member and a formatted document with all the subtitling in one place,"
- but I understand the use of graphic PNG members due to challenges with Unicode, i.e. non-english characters in Text members. 'Hardcodes' graphics are safer!
Her lips said "no!" but her eyes said "read my lips".
Re: need your help with cuepoints! by Moshe Caine on Mar 10, 2009 at 7:08:22 am
Hi.
While your approach should work, I would have actually taken a different approach, that is to attach the subtitles as text sprites to a Quicktime video. To create the synchronized subtitles I use a neat little program called Textation (for mac). Then using simple Lingo you can have buttons which will switch on or off the relevant text tracks in sync with the video.
Good luck.
Re: need your help with cuepoints! by Mooneesh Sid on Mar 11, 2009 at 12:14:44 pm
Thank you for your reply :)...
Actually I have done it the way Brodd Nesset suggested :)... Ehh, but there is still a little problem there, if I change the language, the last cue point appears in previous language, and then when the next cue point comes it changes to the last chosen language... I understand why it happens but I donno how to make it work the proper way...
I feel, I should probably start the movie when language changes so that it shows the right subtitles...
hope someone can help me with that one as well :)...
thanks in advance!