|
From: Anne on 23 Jul 2006 08:20 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 23 Jul 2006 11:16 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 24 Jul 2006 05:03 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 24 Jul 2006 05:00 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 24 Jul 2006 09:31 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/
|
Pages: 1 Prev: 300dpi Image: copy to clipboard?? Next: Setting initial volume of puppetSound |