A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: I dont usually like asking but.....northkingdom / espn

  1. #1

    I dont usually like asking but.....northkingdom / espn

    Here is one of those dreaded how did they do that questions.

    Ok I have seen a few of these since flash 8 came about and was wondering if it is something new in FL8 or if it was just something new folks are doing.

    If you go to ESPN.com under the main story there is a movie that shows substories continually counts down to the next sports substory almost like a reverse countdown preloader or something.

    Same thing in northkingdom.com all of their work has an automatic countdown bar that is always visable. I was just curious and searched the boards but didnt see anything and I figured this was the place to ask.

    Thanks

    c.

  2. #2
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    What you are looking at is just a playhead reversed.
    If you look at any video player (QuickTime for example), you will see a bar showing usually the amount of movie that has already loaded, and a cursor or slider that indicates the current playhead position.

    If you highlight the amount of movie that is left to be seen, there you go...

    Cheers,
    Ascanio.
    Altruism does not exist. Sustainability must be made profitable.

  3. #3
    To me it seems like a script running that counts down however much time is left and then loads the next image.

    If this is in fact what are they using to do this what is the best way to get the bar or visual represntation to attach itself to the timer code?

    I would assume this as what the basics would be for the timer code:

    code:
    this.createTextField("timer_txt", this.getNextHighestDepth(), 0, 0, 100, 22);
    function updateTimer():Void {
    timer_txt.text = getTimer();
    }

    var intervalID:Number = setInterval(updateTimer, 100);


  4. #4
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    I don't get your point. What are you asking? How to make a countdown.

    Supposed it's not like I said (but you should look at the link you gave me, because it looks pretty much like the countdown ends when the movie ends), and that it's just a stupid (in the sense that it doesn't care about external events) countdown, it's a task you can take in many ways.

    Anyway being a graphic effect, I would base it on the onEnterFrame handler.

    Code:
    var timeLap = 10000; // = 10 seconds
    var destinationDate:Number = Date().valueOf() + timeLap;
    myBar.onEnterFrame = function() {
        var currDate:Number = Date().valueOf();
        var timeGap:Number = destinationDate - currDate;
        var timeLeft:Number = timeLap - timeGap;
        var perc:Number = timeLeft / timeLap * 100;
        if(perc < 100) {
            this._xscale = perc;
        } else {
            delete this.onEnterFrame;
        }
    };
    The previous code should reduce the bar 'till it disappears in exactly 10 seconds.
    I haven't tried it..
    Altruism does not exist. Sustainability must be made profitable.

  5. #5
    I guess I was just interested in finding the most effecient way of doing this. I have the countdown part done like you said I was just trying to find the way to attach the graphical element to it.

    sorry for being unclear.

    c.

  6. #6
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    Hey, that's the most fascinating thing about Flash, binding script and graphics..

    In case of preloader bars, the easiest thing to do is use the _xscale property. All you have to do is position the bar SHAPE inside of the MOVIECLIP, aligning the side you want to stay still to the center (0.0x, 0.0y), this way the bar will "grow" from that side to the other.

    Try using the bar as a mask, and putting an animated background under it: this way you can emulate the waiting bars in Mac OSX for example..

    Cheers,
    Ascanio.
    Altruism does not exist. Sustainability must be made profitable.

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