Hey Guys,
Is there anyway to trigger a sound on a particular frame of a movieclip? Thanks in advance!
L
[import]uid: 47290 topic_id: 9368 reply_id: 309368[/import]
Hey Guys,
Is there anyway to trigger a sound on a particular frame of a movieclip? Thanks in advance!
L
[import]uid: 47290 topic_id: 9368 reply_id: 309368[/import]
I found object:currentFrame() which according to the documentation returns the current frame of a movieClip. How would I use this to create a listener to trigger a function? Anybody? [import]uid: 47290 topic_id: 9368 reply_id: 34303[/import]
I was able to do it with a timer instead. Since I don’t need it to be exact, I just check to see if the frame is where I want it and then call a new function.
I hope there is another way to do it. [import]uid: 128282 topic_id: 9368 reply_id: 109751[/import]
i am not an advanced developer, (again) but here is what i would do. (this requires that object:currentFrame() does return the current frame)
***please note this code is untested!***
[lua]local object=movieclip.newAnim{ “image1.png”, “image2.png”, “image3.png” } --set up your object
object:play()
local function findFrame()
local frame=object:currentFrame()
if (frame==2) then
print “at frame #2”
end
end
Runtime:addEventListener( “enterFrame”, findFrame )[/lua]
binc
[import]uid: 147322 topic_id: 9368 reply_id: 109757[/import]
update:
i just tried it and it does work!
binc [import]uid: 147322 topic_id: 9368 reply_id: 109759[/import]
Cool. I think that should work too. Thanks. [import]uid: 128282 topic_id: 9368 reply_id: 109760[/import]