Working With Movie Clips

Hi Everyone,

I’ve got a basic movie clip up and running…my only issue is I don’t know what to do with it once the video is done playing! I’d like it to be “embedded” in my scene but when it gets called up, it takes up the width of the screen, plays until the end, and then the screen goes black. Here’s my basic code that gets the movie to play…

local movie = media.playVideo ("movietest.m4v", true) movie.x = 160 movie.y = 240 localGroup:insert(movie)

I’ve got other things on the screen such as a title and a back button to get out of the scene once the viewer is done watching the video but none of them are visible.

Thanks so much!

[import]uid: 20687 topic_id: 5837 reply_id: 305837[/import]

http://developer.anscamobile.com/reference/index/mediaplayvideo

what’s the rest of your code?

try adding a “complete” listener and then calling localGroup:remove(movie) in there
[import]uid: 6645 topic_id: 5837 reply_id: 20006[/import]

Thanks jmp,

I knew it had to do with a listener somewhere…I just didn’t know I had to remove the movie entirely. I’ll give it a try.

Thanks again! [import]uid: 20687 topic_id: 5837 reply_id: 20010[/import]

Here’s my current code…I’m trying to remove the movie after it’s done playing to get back to the current scene.

[code] local movie = media.playVideo (“movietest.m4v”, true, onComplete)
movie.x = 160
movie.y = 240
localGroup:insert(movie)

local onComplete = function(event)
if event.phase == “ended” then
LocalGroup:remove(movie)
end
end
movie:addEventListener(“remove”,onComplete)
[/code]

When the movie is done playing the screen goes black. Is my code wrong or am I not calling the function correctly? Thanks in advance!
[import]uid: 20687 topic_id: 5837 reply_id: 20091[/import]