would it be possible to post the code you were using before?... maybe it just needs a bit of modification. Btw, what version of Director were you using prior to D11.5?
Thanks for your help with this, Joshua. Below is code that I now found that does work in Director 11.5, but must it be placed into the script channel and each Flash sprite channel must then be specified. The code I used in Director MX 2004 and before was placed directly onto the sprite and the correct sprite channel was automatically set. I know this difference seems minor, but I am using an external cast and so that all Flash sprites in my project are affected (the project is large). Is there a way to modify this code to allow it to be placed onto a Flash sprite where the correct channel is automatically set?
on isOKToAttach me, sType, sNum
return (sType = #script)
lRange = 
repeat with c = 1 to the lastChannel
if sprite(c).member.type = #flash then lRange.append(c)
pdl = [:]
pdl[#flashSprite] = [#comment: "Flash sprite channel:", #format: #integer, #default: 0, #range: lRange]
on beginSprite me
bEnabled = 1
flashSprite = sprite(flashSprite)
tMember = flashSprite.member
if tMember.type <> #flash then
bEnabled = 0
flashFrameCount = tMember.frameCount
on exitFrame me
if bEnabled then
if (flashSprite.frame = flashFrameCount) then
tFrame = _movie.frame + 1
tFrame = _movie.frame
The code you posted looks familiar
There's no way you would have been able to attach it directly to a Flash sprite - the #isOKToAttach handler expressly forbids this. You must have been using a different behavior/script. It can be modified to work directly with the sprite:
property spriteNum property my property flashFrameCount property bEnabled on isOKToAttach me, sType, sNum if (sType = #graphic) then return (sprite(sNum).member.type = #flash) return 0 end on beginSprite me bEnabled = 1 my = sprite(spriteNum) tMember = my.member if tMember.type <> #flash then bEnabled = 0 exit end if flashFrameCount = tMember.frameCount end on exitFrame me if bEnabled then if (my.frame = flashFrameCount) then tFrame = _movie.frame + 1 else tFrame = _movie.frame end if _movie.go(tFrame) end if end
Thanks for your help with this, Sean. Your code works perfectly and exactly replaces the previous code. I obtained my previously posted code from the Director-Online forum or some similar discussion group. If this was your code, it was not idenfied as such, so I thank you. And, you are correct that this was not the old code that I have been using for years (which, to be honest, I could not understand at all - although is did work well before Director 11.5), but was a new attempt at a solution.
As a side note, as I searched the web for solutions, I could not help but notice the tremendous decrease in new Director-related information throughout the web, including discussion posting. This is a very sad note, IMO, and I sure hope Adobe has a good plan for a turn-around (Director 12?). Director remains my program of choice for multimedia work.
Upon further use of your new code, I have discovered one minor difference from the old code that I used in Director MX 2004. In both, the Flash animation plays fully at frame one of a stretched out sprite. But, with the new code, any "go to the frame" in any frames where the entire Flash sprite resides, is ignored (even after the animation has played out). A minor and workable point (I have already found a workaround by splitting the sprite). But, there are times when I want the Flash animation to play and then have that last visual stay on the screen by using a "go to the frame" stop (this is how the old code worked). I cannot achieve this without splitting the sprite and then somehow that magically works (it seems to me that it should replay the entire Flash animation from the beginning, but it does not). Anyhow, Sean thanks again and thanks for all your wonderful support on this forum. I read it regularly.