From: Anne on
Hello:

I have a sprite swf its framecount is 45.
How can control for example a loop three times and after that stop the
animation?t
What parameter do I have to test?
thank you very much


From: Rob Dillon - Adobe Community Expert on
You could probably test the _currentframe property of the flash sprite
and count how many times you see 45.

Something like this might do the job:

--------
property mycounter
property loopcount
property totalFrames
property thisSprite

on getPropertyDescriptionList
myPropList = [:]
myProplist.addProp(#loopcount,[#comment:"number of times to
loop:",#format:#integer,#default:3,#range:[#min:1,#max:10]])
return myPropList
end

on beginSprite me
thisSprite = me.spriteNum
totalFrames = sprite(thisSprite)._totalframes
mycounter = 0
end

on exitFrame me
if sprite(thisSprite)._currentframe = totalFrames then
mycounter = mycounter + 1
end if
if mycounter = loopcount then -- you're done
sprite(thisSprite).stop() -- or sprite(thisSprite).gotoAndStop(1)
end if
end
----------

--
Rob
_______
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
412-243-9119

http://www.macromedia.com/software/trial/
From: Anne on

Thank you.

the propertie _currentframe does no exist.

Can you tell me where do I put and call this behabiours?
In the frame .There isn't "go to the frame"

and in the sprite does not work.

Thanks


From: Anne on
Thank you.
Can you tell me where do I put and call this behabiours?
In the frame .There isn't "go to the frame"

and in the sprite does not work.
Thanks

"Rob Dillon - Adobe Community Expert" <rob@-remove-ddg-designs.com> escribi
en el mensaje news:rob-51A034.11165323072006(a)forums.macromedia.com...
> You could probably test the _currentframe property of the flash sprite
> and count how many times you see 45.
>
> Something like this might do the job:
>
> --------
> property mycounter
> property loopcount
> property totalFrames
> property thisSprite
>
> on getPropertyDescriptionList
> myPropList = [:]
> myProplist.addProp(#loopcount,[#comment:"number of times to
> loop:",#format:#integer,#default:3,#range:[#min:1,#max:10]])
> return myPropList
> end
>
> on beginSprite me
> thisSprite = me.spriteNum
> totalFrames = sprite(thisSprite)._totalframes
> mycounter = 0
> end
>
> on exitFrame me
> if sprite(thisSprite)._currentframe = totalFrames then
> mycounter = mycounter + 1
> end if
> if mycounter = loopcount then -- you're done
> sprite(thisSprite).stop() -- or sprite(thisSprite).gotoAndStop(1)
> end if
> end
> ----------
>
> --
> Rob
> _______
> Rob Dillon
> Adobe Community Expert
> http://www.ddg-designs.com
> 412-243-9119
>
> http://www.macromedia.com/software/trial/


From: Rob Dillon - Adobe Community Expert on
change this:

totalFrames = sprite(thisSprite)._totalframes

to this:

totalFrames = sprite(thisSprite).member.frameCount

--
Rob
_______
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
412-243-9119

http://www.macromedia.com/software/trial/