Link to home
Start Free TrialLog in
Avatar of rgarimella
rgarimella

asked on

Arrays and For Loops

Hi Folks,

I have a videowindow that plays the video. Based on the current frame number i need to perform certain actions. I

I have the following if statements that I need to convert into a array for faster processing. What is the best way to do it

    if ((_parent.video._currentframe > 1135) && (_parent.video._currentframe < 1260)) {
        _root.QA_mc._visible = true;
        _root.QA_mc.gotoAndStop(2);
    }

    if ((_parent.video._currentframe > 1581) && (_parent.video._currentframe < 1699)) {
        _root.QA_mc._visible = true;
        _root.QA_mc.gotoAndStop(3);
    }

    if ((_parent.video._currentframe > 700) && (_parent.video._currentframe < 800)) {
        _root.popup.gotoAndPlay("gettingThere");
    }

Thanks

RG
Avatar of negatyve
negatyve

If this is all the code, I don't think you should use an array, as I cannot see any pattern in that script (no pattern for frame numbers, no pattern for actions - sometimes frame numbers, sometimes labels, sometimes change QA_, sometimes popup..)
Avatar of rgarimella

ASKER

Actualy I have more than displayed here. I was just putting a sample

ASKER CERTIFIED SOLUTION
Avatar of negatyve
negatyve

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial