A Flash Developer Resource Site

Results 1 to 20 of 40

Thread: [CS3] Help With my code!

Threaded View

  1. #14
    Member
    Join Date
    Aug 2008
    Posts
    39
    hi ive been trying to duplicate your code for some text with static backgrounds

    so there is a bakground colour and the text fades on top of it

    i thought i changed all the names right but i must of missed of left something out

    heres the code, it prioduces no errors, just doesnt work

    Code:
    import fl.transitions.Tween;
    import fl.transitions.TweenEvent;
    import fl.transitions.easing.*;
    var text1Tween:Tween = new Tween (text_mc.text1_mc, "alpha", None.easeInOut, 0 , 1 , 2 , true );
    text1Tween.stop();
    text1Tween.addEventListener(TweenEvent.MOTION_FINISH,fadeOutText);
    var text2Tween:Tween = new Tween (text_mc.text2_mc, "alpha", None.easeInOut, 0 , 1 , 2 , true );
    text2Tween.stop();
    var text3Tween:Tween = new Tween (text_mc.text3_mc, "alpha", None.easeInOut, 0 , 1 , 2 , true);
    text3Tween.stop();
    
    text_mc.text1_mc.nextTween = text2Tween;
    text_mc.text2_mc.nextTween = text3Tween;
    text_mc.text3_mc.nextTween = text1Tween;
    
    text1Tween.start();
    
    function fadeOutText(event:TweenEvent) {
    event.target.removeEventListener(TweenEvent.MOTION_FINISH, fadeOutText);
    event.target.addEventListener(TweenEvent.MOTION_FINISH, startNextText);
    event.target.begin = 1;
    event.target.finish = 0;
    event.target.start();
    }
    function startNextText(event:TweenEvent) {
    event.target.removeEventListener(TweenEvent.MOTION_FINISH, startNextText);
    event.target.obj.nextTween.addEventListener(TweenEvent.MOTION_FINISH, fadeOutText);
    event.target.obj.nextTween.begin = 0;
    event.target.obj.nextTween.finish = 1;
    event.target.obj.nextTween.start();
    }
    and the fla so you can see what ive done easier

    thanks for any help
    Attached Files Attached Files

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