Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Feb 2010
    Posts
    231
    Thanks
    25
    Thanked 0 Times in 0 Posts

    Simple 'like' button function

    Sorry if this is in the wrong place, but it's only because I don't really know what would be needed to achieve it.

    Is there a simple piece of coding that could show a 'like' graphic (thumbs up, etc) and then a counter alongside showing how many visitors have hit it?

    I have a tumblr account and want to place such a thing at the foot of each post. If it requires this side-server malarkey then I'll forget it now, but I was just wondering if it was simpler than that.

    I can create the graphic, no problem, and wouldn't want the function to do anything other than show a button and a counter indicating the number of times it's been pressed, i.e "17 people like this"

    Thanks in advance.
    Last edited by OurJud; 10-26-2011 at 05:59 PM. Reason: tumblr, blogs

  • #2
    New Coder
    Join Date
    Aug 2011
    Location
    Gold Coast, Australia
    Posts
    16
    Thanks
    1
    Thanked 1 Time in 1 Post
    Here is how you would create this in actionscript with an image named 'button'

    Code:
    var counter:int; // declare counting variable
    button.addEventListener(MouseEvent.CLICK, count); // add listener for the button
    
    function count(event:MouseEvent)
    {
    	counter ++; // increase count by one
    	trace(counter); // output total clicks
    }

  • #3
    Regular Coder
    Join Date
    Feb 2010
    Posts
    231
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Thanks for the replies. judthryn, it's not a facebook like button I'm after, just a button that counts the number of times it's pressed.

    Cammy - that reply is a little vague for my level of knowledge. What I was hoping for was a simple block of html and some css to style it. I'm afraid I have no idea what I'm supposed to do with the code you've supplied. Sorry.

  • #4
    Mr.
    Mr. is offline
    Regular Coder
    Join Date
    Feb 2011
    Posts
    112
    Thanks
    8
    Thanked 4 Times in 4 Posts
    you were hoping for some HTML and CSS to style it?? You're asking a flash question... in a flash forum... and Cammy gave you the exact answer to your question. That is how you track the number of times your "like" is clicked using flash. Obviously your question is too vague or not appropriate for the forum you're posting in.

  • #5
    Regular Coder
    Join Date
    Feb 2010
    Posts
    231
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Mr. View Post
    you were hoping for some HTML and CSS to style it?? You're asking a flash question... in a flash forum... and Cammy gave you the exact answer to your question. That is how you track the number of times your "like" is clicked using flash. Obviously your question is too vague or not appropriate for the forum you're posting in.
    Or just maybe, Mr, as you'd have realised if you'd read my OP fully, I know very little about web design and programming and wasn't sure where I should be asking this question. Nor is it my fault that I don't understand Cammy's answer. If I knew what I was doing, I wouldn't be here, would I!? We can't all be website-building geniuses like yourself!
    Last edited by OurJud; 10-30-2011 at 02:53 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •