Loading a movie from a list box

Hi,

I am trying to create a window with a list of movies in a list box, and once the user selects one, it will play in the movie in the QT movie in the window. I am using XCODE 3.0 for this.

For test purposes, I am able to get the list box to produce a dialog with the name of the contents of the cell, but I am not able to get it to load a movie. I get the below error message when I use this code. I am sure that I am missing something, but I am just not sure what. Any help with this would be greatly appreciated.

Code:


on double clicked theObject
	
	set AA to selected row of table view "Movie List" of scroll view "Movie List" of window "How To"
	set BB to contents of AA

	if BB = 1 then
		--display dialog "Test Movie 1"
		set movie of movie view "Movie" of window "How_To_Videos" to load movie "test.mov"
	
	else if BB = 2 then
		--	display dialog "Test Movie 2"
		set movie of movie view "Movie" of window "How_To_Videos" to load movie "test2"

	end if
end double clicked

Error Message:

"Can’t set <> “Movie” of window “How To” to <> id 34. (-10006)

Thanks,

CM

Where have you stored these movies you are trying to play?
Are they QT movies you have imported as resources into your project?
In this case the correct syntax would be the one you have used for the second movie, i.e. just the name, without extension.

If, however these movies are stored outside the project, somewhere on your harddisk, you have to use the full alias path (diskname:foldername:moviename.mov)

The example files - usually located in /Developer/Examples/AppleScript Studio/ - contain an example by Apple called “Talking Head” that describes the procedure.

Good scripting
Farid