Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
gotoandplay — Gideros Forum

gotoandplay

JackoJacko Member
edited July 2014 in General questions
can someone explain me what is gotoandplay i know that it start animation but when i changing value of 1 nothing chang
-- Start animating mc1
gotoAndPlay(1)
help

Comments

  • ar2rsawseenar2rsawseen Maintainer
    edited July 2014
    @Jacko it all depends on your movie clip
    basically it tells movie clip to go to specific frame and start playing from it

    For example if I have multiple animations
    local mc = MovieClip.new({
    	--running
    	{1, 5, t[1]},
    	{6, 10, t[2]},
    	{11, 15, t[3]},
    	{16, 20, t[4]},
    	{21, 25, t[5]},
    	{26, 30, t[6]},
    	{31, 35, t[7]},
    	{36, 40, t[8]},
    	--hit
    	{101, 105, t[20]},
    	{106, 125, t[21]},
    	{126, 130, t[20]},
    	--punch
    	{201, 205, t[9]},
    	{206, 210, t[12]},
    	{211, 215, t[13]},
    	{216, 230, t[14]},
    	--jump
    	{401, 410, t[15]},
    	{411, 420, t[16]},
    	{421, 440, t[17]},
    	{441, 450, t[18]},
    	{451, 460, t[19]},
    	--lost
    	{601, 610, t[20]},
    	{611, 620, t[21]},
    	{621, 630, t[22]},
    })
    I can then loop or chain them using go to actions:
    self.mc:setGotoAction(40, 1)
    self.mc:setGotoAction(130, 1)
    self.mc:setGotoAction(230, 1)
    self.mc:setGotoAction(450, 1)
    self.mc:setGotoAction(720, 1)
    And by default character will run:
    mc:play()
    But when I want character to punch, I just call:
    mc:gotoAndPlay(201)
  • JackoJacko Member
    uuuu thank you very much
  • JackoJacko Member
    are there somthig like:
    stop animation on frame : 100
  • JackoJacko Member
    yes ofc sorry for be so ignorant. thank you
  • yubaroyubaro Member
    @Jacko no need to apologize, here we all learn together!

    Likes: talis

    +1 -1 (+1 / -0 )Share on Facebook
  • generaly I can only set frame? or ther is something like value of loop? i know that i can use "while" or "for".
Sign In or Register to comment.