#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    1
    Rep Power
    0

    Need help... motion tween buttons


    Hey people!

    I started creating my site but my poor flash skills stopped me
    My problem: I have created the initial part with some motion tweens that moves around som objects in the scene, when these have settled in their place I want these to work as buttons but I dont know how to do that. So if anyone could help me I will be happy. Both with turning them into buttons but also linking them to the next page of the site.

    I have used actionscript 2.0 in cs5

    so please guys, any help is greatly appreciated

    brgds
  2. #2
  3. Plays with fire
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2003
    Location
    Barsoom
    Posts
    942
    Rep Power
    97
    What tween engine are you using?

    I'm a bit rusty with Flash's built in engine built by Adobe, but you're looking for an onFinished event to fire when the tween stops. When it stops, add a new listener for a click event.

    Kind of like this:

    Code:
    myTween.addEventListener(TweenEvent.COMPLETE, makebutton);
    
    function makebutton(e:TweenEvent):void {
       myTween.removeEventListener(TweenEvent.COMPLETE, makebutton);
       myObject.addEventListener(MouseEvent.CLICK, myClickReaction);
    }
    
    function myClickReaction(e:Event):void {
      // button code
    }
    “Be ashamed to die until you have won some victory for humanity.” -- Horace Mann

    "...all men are created equal." -- US Declaration of Independence

IMN logo majestic logo threadwatch logo seochat tools logo