Old 11-21-2009, 12:58 PM   #1
dcrystalj
Registered User
6-->8

hi
does anyone know what is difference beetween flash 6 and 8?

i need to put these actionscript from 6 to 8
Code:
// ==============================================================
// FUNCTIONS
// ==============================================================
// FUNCTION: Calulate difference (elapsed time value).
fncCalcElapsed = function (nbrTime0, nbrTime1) {
    return nbrTime1-nbrTime0;
};
// ------------------------------------
// FUNCTION: Pad numbers with zeros so always two digits.
fncNbrPad = function (nbrValue) {
    // Concatenate zeros (prepend).
    var stgValue = "00"+nbrValue;
    // Return last two digits.
    return stgValue.substr(stgValue.length-2);
};
// ------------------------------------
// FUNCTION: Display formatting function.
fncDisplayFormat = function (nbrHr, nbrMin, nbrSec, nbrHnd) {
    // Assign to display textfield text property text returns from number padding function for each value.
    tfdDisplay.text = fncNbrPad(nbrHr)+":"+fncNbrPad(nbrMin)+":"+fncNbrPad(nbrSec)+":"+fncNbrPad(nbrHnd);
};
// ------------------------------------
// FUNCTION: Update the display values.
fncDisplayUpdate = function () {
    // Calcuate elapsed value from current timing plus previous value.
    nbrTimeElapsed = fncCalcElapsed(nbrTrackStart, getTimer())+nbrTrackPrev;
    // Call fncParse function to parse the elapsed time into units and display accordingly.
    fncParse(nbrTimeElapsed);
};
// ------------------------------------
// FUNCTION: Function to track time whether in stopped state or running state
fncTrackStatus = function () {
    // If current status is "running" (started)...
    if (blnStatus) {
        // Clear interval (stops updating).
        clearInterval(itvTime);
        // Store the new time elapsed value (which includes previous values).
        nbrTrackPrev = nbrTimeElapsed;
        // Else current status is "not running" (stopped)...
    } else {
        // Store current timer value.
        nbrTrackStart = getTimer();
        // Launch interval to call fncDisplayUpdate.
        itvTime = setInterval(fncDisplayUpdate, 10);
    }
};
// ------------------------------------
// FUNCTION: extract unit values (hours, minutes, seconds, and hundredths of seconds)
// from number of milliseconds elapsed.
fncParse = function (nbrMilliseconds) {
    // Calculate hundredths of a second.
    var nbrHnd = Math.floor(nbrMilliseconds/10)%100;
    // Calculate seconds.
    var nbrSec = Math.floor(nbrMilliseconds/1000)%60;
    // Calculate minutes.
    var nbrMin = Math.floor(nbrMilliseconds/60000)%60;
    // Calculate hours.
    var nbrHr = Math.floor(nbrMilliseconds/3600000)%24;
    // Call display formatting function.
    fncDisplayFormat(nbrHr, nbrMin, nbrSec, nbrHnd);
};
// ==============================================================
// INITIALIZE
// ==============================================================
// Establish boolean variable and initialize, to contain 
// value representing status: 0 = stopped; 1 = running
blnStatus = 0;
// Establish array of strings to use for button label (to indicate next action).
mvcBtnStartStop.rraLabel = ["START", "STOP"];
// Initialize textfield label for button.
mvcBtnStartStop.tfdBtnLabel.text = mvcBtnStartStop.rraLabel[blnStatus];
// Define button event.
mvcBtnStartStop.onPress = function() {
    this._parent.fncTrackStatus();
    this._parent.blnStatus = Number(!this._parent.blnStatus);
    this.tfdBtnLabel.text = this.rraLabel[this._parent.blnStatus];
};
// Conditional that starts tracking only if blnStatus is initialized to 1, above.
if (blnStatus) {
        // Store current timer value.
        nbrTrackStart = getTimer();
        // Launch interval to call fncDisplayUpdate.
        itvTime = setInterval(fncDisplayUpdate, 10);
}
// ==============================================================
dcrystalj is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?
 

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:10 PM.

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
Flash effects. Art without coding. Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Learn how to advertise on kirupa.com
 

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com