All pastes #407742 Raw Edit

Wee_NA_SRC

public text v1 · immutable
#407742 ·published 2007-03-24 08:59 UTC
rendered paste body
function ChangeSlotText()
{
    var _loc2 = 0;
    for (i = 0; i < 3; i++)
    {
        if (CharactersSelected[i] == "")
        {
            ++_loc2;
        } // end if
    } // end of for
    switch (_loc2)
    {
        case 0:
        {
            this.SlotTextHolder.SlotText.text = "YOU ARE READY TO START A GAME";
            break;
        } 
        case 1:
        {
            this.SlotTextHolder.SlotText.text = "DRAG 1 MORE CHARACTER INTO YOUR TEAM";
            break;
        } 
        case 2:
        {
            this.SlotTextHolder.SlotText.text = "DRAG 2 MORE CHARACTERS INTO YOUR TEAM";
            break;
        } 
        case 3:
        {
            this.SlotTextHolder.SlotText.text = "DRAG 3 CHARACTERS INTO YOUR TEAM";
            break;
        } 
    } // End of switch
} // End of the function
function LoadCharVars(id)
{
    var cid = id - 1;
    _root.charspecs.charinfo.charava.holder.loadMovie(_root.path + "images/characters/" + id + "/avatarlarge.jpg", _root.charspecs.charinfo.charava.holder);
    _root.charspecs.charinfo.charname.tx_charname.htmlText = CharSpecs[cid][0];
    trace (CharSpecs[cid][0]);
    _root.charspecs.charinfo.chardesc.tx_chardesc.htmlText = CharSpecs[cid][1];
    loadskillspecs(CharSpecs[cid][3], CharSpecs[cid][4], CharSpecs[cid][5], CharSpecs[cid][6]);
    loadChakra(CharSpecs[cid][6]);
    for (c = 0; c <= 5; c++)
    {
        _root.charspecs.charinfo["button" + c].onRollOver = function ()
        {
            _root.newCursor.gotoAndStop("over");
            onButton = true;
        };
        _root.charspecs.charinfo["button" + c].onRollOut = function ()
        {
            _root.newCursor.gotoAndStop("normal");
            onButton = false;
        };
    } // end of for
    _root.charspecs.charinfo.button1.holder.loadMovie(_root.path + "images/skills/" + CharSpecs[cid][3] + "/avatarlarge.jpg", _root.charspecs.charinfo.button1.holder);
    _root.charspecs.charinfo.button1.onRelease = function ()
    {
        var _loc2 = new Sound();
        _loc2.attachSound("release");
        _loc2.start(0, 1);
        _loc2.setVolume(100);
        _root.charspecs.skillspecs.gotoAndPlay("start");
        loadskillspecs(CharSpecs[cid][3], CharSpecs[cid][4], CharSpecs[cid][5]);
        deletelastskill(lastskill);
        loadChakra(CharSpecs[cid][6]);
        lastskill = CharSpecs[cid][6];
    };
    _root.charspecs.charinfo.button2.holder.loadMovie(_root.path + "images/skills/" + CharSpecs[cid][7] + "/avatarlarge.jpg", _root.charspecs.charinfo.button2.holder);
    _root.charspecs.charinfo.button2.onRelease = function ()
    {
        var _loc2 = new Sound();
        _loc2.attachSound("release");
        _loc2.start(0, 1);
        _loc2.setVolume(100);
        _root.charspecs.skillspecs.gotoAndPlay("start");
        loadskillspecs(CharSpecs[cid][7], CharSpecs[cid][8], CharSpecs[cid][9], CharSpecs[cid][10]);
        deletelastskill(lastskill);
        loadChakra(CharSpecs[cid][10]);
        lastskill = CharSpecs[cid][10];
    };
    _root.charspecs.charinfo.button3.holder.loadMovie(_root.path + "images/skills/" + CharSpecs[cid][11] + "/avatarlarge.jpg", _root.charspecs.charinfo.button3.holder);
    _root.charspecs.charinfo.button3.onRelease = function ()
    {
        var _loc2 = new Sound();
        _loc2.attachSound("release");
        _loc2.start(0, 1);
        _loc2.setVolume(100);
        _root.charspecs.skillspecs.gotoAndPlay("start");
        loadskillspecs(CharSpecs[cid][11], CharSpecs[cid][12], CharSpecs[cid][13], CharSpecs[cid][14]);
        deletelastskill(lastskill);
        loadChakra(CharSpecs[cid][14]);
        lastskill = CharSpecs[cid][14];
    };
    _root.charspecs.charinfo.button4.holder.loadMovie(_root.path + "images/skills/" + CharSpecs[cid][15] + "/avatarlarge.jpg", _root.charspecs.charinfo.button4.holder);
    _root.charspecs.charinfo.button4.onRelease = function ()
    {
        var _loc2 = new Sound();
        _loc2.attachSound("release");
        _loc2.start(0, 1);
        _loc2.setVolume(100);
        _root.charspecs.skillspecs.gotoAndPlay("start");
        loadskillspecs(CharSpecs[cid][15], CharSpecs[cid][16], CharSpecs[cid][17], CharSpecs[cid][18]);
        deletelastskill(lastskill);
        loadChakra(CharSpecs[cid][18]);
        lastskill = CharSpecs[cid][18];
    };
} // End of the function
function loadChakra(chakra)
{
    var _loc2 = 0;
    for (c = 0; c < chakra.length; c++)
    {
        _root.charspecs.skillspecs.chakraholder.attachMovie("mc_chakra" + chakra.substr(c, 1), "chakra" + c, _root.charspecs.skillspecs.chakraholder.getNextHighestDepth());
        _root.charspecs.skillspecs.chakraholder["chakra" + c]._x = 0 + _loc2;
        _root.charspecs.skillspecs.chakraholder["chakra" + c]._y = 0;
        _loc2 = _loc2 + 15;
        lastskill = chakra;
    } // end of for
} // End of the function
function deletelastskill(lastskill)
{
    if (lastskill != "")
    {
        for (c = 0; c < lastskill.length; c++)
        {
            removeMovieClip (_root.charspecs.skillspecs.chakraholder["chakra" + c]);
        } // end of for
    } // end if
} // End of the function
function loadskillspecs(skillid, skillname, skilldesc, skillreq)
{
    _root.charspecs.skillspecs.skillava.holder.loadMovie(_root.path + "images/skills/" + skillid + "/avatarlarge.jpg", _root.charspecs.skillspecs.skillava.holder);
    _root.charspecs.skillspecs.skillname.tx_skillname.htmlText = skillname;
    _root.charspecs.skillspecs.skilldesc.tx_skilldesc.htmlText = skilldesc;
} // End of the function
function mc_close()
{
    _root.charspecs.mc_close.onRollOver = function ()
    {
        _root.newCursor.gotoAndStop("over");
        onButton = true;
    };
    _root.charspecs.mc_close.onRollOut = function ()
    {
        _root.newCursor.gotoAndStop("normal");
        onButton = false;
    };
    _root.charspecs.mc_close.onPress = function ()
    {
        _root.charspecs.gotoAndPlay("close");
        charspecs_id = "";
    };
} // End of the function
var onButton = false;
var charspecs_id = "";
var xold = 0;
var yold = 0;
var lastskill = "";
var CharactersSelected = new Array("", "", "");
this.PlayerTextHolder.tx_PlayerInfo.htmlText = PlayerText;
this.UserAvatar.holder.loadMovie(_root.path + avatarlink, this.UserAvatar.holder);
var xStartCharButtons = 555;
var yStartCharButtons = 40;
var xBetweenCharButtons = 56;
var yBetweenCharButtons = 56;
for (y = 0; y < CharacterArray.length; y++)
{
    if (CharacterArray[y].substr(0, 1) == "y")
    {
        var CharacterID = CharacterArray[y];
        this.attachMovie("mc_characterbutton", "char" + CharacterID, this.getNextHighestDepth());
        this["char" + CharacterID].holder.loadMovie(_root.path + "images/characters/" + CharacterID.substr(1) + "/avatarselection.jpg?2", ["char" + CharacterID]);
        this["char" + CharacterID]._x = xStartCharButtons + (y - Math.floor(y / 4) * 4) * xBetweenCharButtons;
        this["char" + CharacterID]._y = yStartCharButtons + Math.floor(y / 4) * yBetweenCharButtons;
        this["char" + CharacterID].onPress = function ()
        {
            this.swapDepths(1000);
            this.startDrag();
            xold = this._x;
            yold = this._y;
        };
        this["char" + CharacterID].onRollOver = function ()
        {
            this._parent.newCursor.gotoAndStop("over");
            onButton = true;
        };
        this["char" + CharacterID].onRollOut = function ()
        {
            this._parent.newCursor.gotoAndStop("normal");
            onButton = false;
        };
        this["char" + CharacterID].onRelease = function ()
        {
            var _loc6 = this._name.substr(4);
            this.stopDrag();
            var _loc5 = false;
            for (l = 0; l < 3; l++)
            {
                if (CharactersSelected[l] == this._name)
                {
                    CharactersSelected[l] = "";
                    var _loc3 = "n" + l;
                } // end if
            } // end of for
            for (i = 0; i < 3; i++)
            {
                if (this.hitTest(this._parent["charslot" + i]))
                {
                    _loc5 = true;
                    if (CharactersSelected[i] != "")
                    {
                        if (_loc3)
                        {
                            CharactersSelected[_loc3.charAt(1)] = CharactersSelected[i];
                            this._parent[CharactersSelected[i]]._x = this._parent["charslot" + _loc3.charAt(1)]._x + 25;
                            this._parent[CharactersSelected[i]]._y = this._parent["charslot" + _loc3.charAt(1)]._y + 25;
                        }
                        else
                        {
                            for (k = 0; k < CharacterArray.length; k++)
                            {
                                if (CharacterArray[k] == this._parent[CharactersSelected[i]]._name.substr(4))
                                {
                                    var _loc4 = k;
                                } // end if
                            } // end of for
                            this._parent[CharactersSelected[i]]._x = xStartCharButtons + (_loc4 - Math.floor(_loc4 / 4) * 4) * xBetweenCharButtons;
                            this._parent[CharactersSelected[i]]._y = yStartCharButtons + Math.floor(_loc4 / 4) * yBetweenCharButtons;
                        } // end if
                    } // end else if
                    CharactersSelected[i] = this._name;
                    this._x = this._parent["charslot" + i]._x + 25;
                    this._y = this._parent["charslot" + i]._y + 25;
                    break;
                } // end if
            } // end of for
            if (!_loc5)
            {
                for (i = 0; i < CharacterArray.length; i++)
                {
                    if (CharacterArray[i] == _loc6)
                    {
                        _loc4 = i;
                    } // end if
                } // end of for
                if (_loc3)
                {
                    for (c = 0; c < CharacterArray.length; c++)
                    {
                        if (this.hitTest(this._parent["char" + CharacterArray[c]]) && c != _loc4 && this._parent["char" + CharacterArray[c]]._name.substr(4, 1) == "y")
                        {
                            CharactersSelected[_loc3.charAt(1)] = "char" + CharacterArray[c];
                            this._parent["char" + CharacterArray[c]]._x = this._parent["charslot" + _loc3.charAt(1)]._x + 25;
                            this._parent["char" + CharacterArray[c]]._y = this._parent["charslot" + _loc3.charAt(1)]._y + 25;
                            break;
                        } // end if
                    } // end of for
                } // end if
                this._x = xStartCharButtons + (_loc4 - Math.floor(_loc4 / 4) * 4) * xBetweenCharButtons;
                this._y = yStartCharButtons + Math.floor(_loc4 / 4) * yBetweenCharButtons;
                for (i = 0; i < 3; i++)
                {
                    if (CharactersSelected[i] == this._name)
                    {
                        CharactersSelected[i] = "";
                    } // end if
                } // end of for
            } // end if
            ChangeSlotText();
            if (xold == this._x && yold == this._y)
            {
                var _loc7 = this._name.substr(5);
                if (charspecs_id != _loc7 && charspecs_id != "")
                {
                    _root.charspecs.skillspecs.gotoAndStop("blank");
                    _root.charspecs.charinfo.gotoAndStop("blank");
                    _root.charspecs.mc_close.gotoAndStop("blank");
                    _root.charspecs.chakraindex.gotoAndStop("blank");
                    charspecs_id = _loc7;
                    this._parent.charspecs.gotoAndPlay("move_out_in");
                    deletelastskill(lastskill);
                    LoadCharVars(charspecs_id);
                }
                else if (charspecs_id == "")
                {
                    charspecs_id = _loc7;
                    this._parent.charspecs.gotoAndPlay("move_in");
                    deletelastskill(lastskill);
                    LoadCharVars(charspecs_id);
                } // end if
            } // end else if
        };
        this["char" + CharacterID].onReleaseOutside = this["char" + CharacterID].onRelease;
        continue;
    } // end if
    var CharacterID = CharacterArray[y];
    this.attachMovie("mc_characterbuttonoff", "char" + CharacterID, this.getNextHighestDepth());
    this["char" + CharacterID].holder.loadMovie(_root.path + "images/characters/" + CharacterID.substr(1) + "/avatarselection.jpg?3", ["char" + CharacterID]);
    this["char" + CharacterID]._x = xStartCharButtons + (y - Math.floor(y / 4) * 4) * xBetweenCharButtons;
    this["char" + CharacterID]._y = yStartCharButtons + Math.floor(y / 4) * yBetweenCharButtons;
} // end of for
mc_close();
this.attachMovie("cursor", "newCursor", this.getNextHighestDepth());
newCursor.swapDepths(5000);
_root.onEnterFrame = function ()
{
    Mouse.hide();
    newCursor._x = _root._xmouse;
    newCursor._y = _root._ymouse;
};
onMouseDown = function ()
{
    this.newCursor.gotoAndStop("down");
};
onMouseUp = function ()
{
    if (!onButton)
    {
        this.newCursor.gotoAndStop("normal");
    }
    else
    {
        this.newCursor.gotoAndStop("over");
    } // end else if
};