A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: fading problem!!!

  1. #1
    Member
    Join Date
    Feb 2005
    Location
    copenhagen
    Posts
    72

    fading problem!!!

    Hi i havent worked with actionscript for awhile and have a little problem !!

    I have a picture that i fade with this code:

    Actionscript Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    new Tween(bg_billede, "_alpha", Strong.easeOut, 0, 100, 18, false);
    but i want it to wait 10 frames before it starts to fade! how do i do that?? im using AS2 please help a pretty desperate guy...
    - - - - - - - -

  2. #2
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    Try something like this
    Actionscript Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var timed:Number = setTimeout(fader, 2000)//wait 2 seconds before firing
    function fader(){
    new Tween(bg_billede, "_alpha", Strong.easeOut, 0, 100, 18, false);
    }

    Hope it helps
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  3. #3
    Member
    Join Date
    Feb 2005
    Location
    copenhagen
    Posts
    72
    Thanks that was just what i was searching for works perfect!!
    now im just curious, is it possible to turn the seconds into frames so that it is a number of frames before my fading starts ?
    - - - - - - - -

  4. #4
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    You could bin the timeout and instead on the tenth frame have fader()
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  5. #5
    Member
    Join Date
    Feb 2005
    Location
    copenhagen
    Posts
    72
    yes i could im just trying to keep everything in the first frame anywho it works fine thanks very much::!
    - - - - - - - -

  6. #6
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    ok np
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

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