View Single Post
  #5 (permalink)  
Old 10-15-2008, 06:13 PM
Production Monkey
 
Posts: n/a
Diggs:
Default Re: Film loops and rotation

I threw together a basic image cycling behavior. To use it, place your walk
cycle images in their own folder. Drag the first image to the stage and attach
the behavior. You should have the same effect as a film loop, except now you
can rotate the sprite because it is not a film loop.

Depending on your needs you may want to create each movement cycle as a
seperate Director movie and then bring them into your main movie as linked
Director movies with the "scripts enabled" button checked. This would make
things more modular. If you take this route then the Rotation script I provided
will work.

-- image cycler

property pMe
property pCastName
property pImageCount
property pCurImageNum


on beginsprite me
pMe = sprite(me.spriteNum)
pCastName = castLib(pMe.member.castLibNum).name
pImageCount = castLib(pCastName).member.count
pCurImageNum = 1
end


on enterframe me
pCurImageNum = pCurImageNum + 1
if pCurImageNum > pImageCount then pCurImageNum = 1
pMe.member = member(pCurImageNum, pCastName)
end

Reply With Quote