+ Reply to Thread
Results 1 to 4 of 4

[AS3.0]Tween Problem

This is a discussion on [AS3.0]Tween Problem within the Actionscript 3.0 newbies forums, part of the Flash English category; Hello all! im learning how to make tweens in AS3.0... i made my tween function inside a Class, so i ...

  1. #1
    Junior Member Settled In ibrahack is on a distinguished road ibrahack's Avatar
    Join Date
    Jan 2008
    Posts
    6
    Rep Power
    0

    [AS3.0]Tween Problem

    Hello all! im learning how to make tweens in AS3.0... i made my tween function inside a Class, so i can practice tweens and classes.. anyway! i want after i click my button and movieclip makes the tween that button doesn't work again, button does not make the tween again if the movieclip is already in that X position.. ill post code here and the link with sources too.. thanks a lot guys...

    Code:
    package
    {
        import fl.transitions.Tween;
        import fl.transitions.easing.*;
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        
        public class TweeningClass extends MovieClip
        {
            var inTween:Tween;
            var outTween:Tween;
            
            public function TweeningClass()
            {
                left_mc.buttonMode = true;
                right_mc.buttonMode = true;
                left_mc.addEventListener(MouseEvent.CLICK, clickEaseOut);
                right_mc.addEventListener(MouseEvent.CLICK, clickEaseIn);
            }
            
            private function clickEaseIn(event:MouseEvent):void
            {
                inTween = new Tween(monitor_mc,"x",Elastic.easeOut,255,700,1,true);
            }
            
            private function clickEaseOut(event:MouseEvent):void
            {
                outTween = new Tween(monitor_mc,"x",Elastic.easeOut,700,255,1,true);
            }
        }
    }
    http://www.ibrastudio.com/classwithtweeningPractice.rar

  2. #2
    CSS.FlepStudio.org Moving My Stuff To The FlepStudio Onsitus is on a distinguished road Onsitus's Avatar
    Join Date
    Jul 2007
    Posts
    1,436
    Rep Power
    7

    Re: [AS3.0]Tween Problem

    Hi,

    a solution could be removeEventListener

    Esempio:
    Code:
    private function clickEaseIn(event:MouseEvent):void
            {
                inTween = new Tween(monitor_mc,"x",Elastic.easeOut,255,700,1,true);
                right_mc.removeEventListener(MouseEvent.CLICK, clickEaseIn);
            }

  3. #3
    Junior Member Settled In ibrahack is on a distinguished road ibrahack's Avatar
    Join Date
    Jan 2008
    Posts
    6
    Rep Power
    0

    Re: [AS3.0]Tween Problem

    im going to try that! ill let you know! thanks thanks a lot Onsitus...

  4. #4
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,762
    Rep Power
    11

    Re: [AS3.0]Tween Problem

    Or just 'play' with:
    left_mc.mouseEnabled=true;

    and

    left_mc. mouseEnabled =false;

+ Reply to Thread

LinkBacks (?)

  1. 27-07-12, 17:39
  2. 06-11-08, 03:34

Similar Threads

  1. Tween Caurina
    By omar1234 in forum Actionscript 3.0 avanzato
    Replies: 1
    Last Post: 28-12-09, 08:21
  2. as motion tween
    By triad boy in forum Flash English
    Replies: 3
    Last Post: 05-12-08, 13:41
  3. Tween color change for text field problem
    By samohtwerdna in forum advanced Actionscript 3.0
    Replies: 0
    Last Post: 02-10-08, 01:47
  4. tween in successione
    By skill83 in forum Flash Italiano
    Replies: 0
    Last Post: 01-08-08, 09:25
  5. MC Tween
    By damn73 in forum Flash Italiano
    Replies: 12
    Last Post: 29-02-08, 05:59

Tags for this Thread

Bookmarks

Posting Permissions

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