dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Click on a graphic *** warning real newbie question

  1. #1
    Member
    Join Date
    Jul 2009
    Posts
    37

    Click on a graphic *** warning real newbie question

    Newbie question.

    Using AS3

    I want to have an addeventlistener to fire off when I click on a graphic.

    What is the best way to do that?

    Should it be a pushbutton component or something else, and how do you get the graphic?

    know it is probably a very basic question but ...

    Thanks

    Steven

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    add image or graphic, select it and covert to movieclip via Icon on toolpanel or menu
    then you just add the code
    mc1.addEventListener(MouseEvent.CLICK,clicked);

    function clicked(e:MouseEvent):void{
    trace("click");
    }

  3. #3
    Member
    Join Date
    Jul 2009
    Posts
    37
    Thanks for your help, it worked.

    I thought that converting it to a button was enough

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Well you can convert it to a button as well, that just isn't what I do. I prefer to make them movieclips instead.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center