September 8, 2015 at 3:32 pm #84179
Hi, i have the following things into a button:
– edit variable = count + 1
– play sound
– play animation
– condition “If count = 5 then
it works, but i need to know how i can made that the button can be press it just 1 time.
Example: the kids touch the button, then run all that i mention but if the kids touch againg de same button i won’t do it nothing.
ThanksSeptember 8, 2015 at 4:03 pm #84182
It took me a while to figure out.
Try to add the following code to you button through Add External Code. You can do it just after your END if.
self:removeEventListener(“tap”, onnameofyourbuttonimageEvent )
You have to replace
by the name of the image layer of your button. Not the name of the button.
Publish and see the result.
Hope it helps.September 9, 2015 at 11:38 pm #84183
Thanks for the answer i try it but didn’t work, this is what corona say:September 9, 2015 at 11:41 pm #84185
Ok this is the link of the picture… http://2.1m.yt/pbvFqfw1P.pngSeptember 10, 2015 at 2:17 am #84187
Can you post a copy/paste of what Corona says on line 765 of your Corona project? If you do not know how to do it, just get Notepad++ (free) and open page 6. Do this message appear as a result of the line of code I have provided?
There is also something going on on your page 3, line 711, I guess!September 10, 2015 at 7:51 pm #84191September 11, 2015 at 5:11 am #84199
It seems that you have missed part of the code.
Where you have earsdad (I think this is what you have written-I can not see very well) on line 765 replace by
Please not that this works as follows:
your layer name (earsdad?)
Use Notepad++ again to edit the code.
As far as page 13 is concerned I do not know. Try to solve the button issue and see what happens.
You must be logged in to reply to this topic.