A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [RESOLVED] Flash 8 AS2 deleting a function possible?

Threaded View

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    resolved [RESOLVED] Flash 8 AS2 deleting a function possible?

    Hey!

    I'm working on a game where once i have all my moviClips set, I want to jump to the game playing frame, but I can't come up with a way to delete the function that places them in the startup frame.

    My code is included in a function that enables dragging the players named placePlayers(), but when I manage to get to the game frame, the movieClips are still draggable which is what I need to avoid before trying to program the real game.

    this is the code to place the players in first frame:

    for (i=0; i<6; i++) {
    this.attachMovie("botoBarça", "botoBarça"+i, this.getNextHighestDepth());
    this.attachMovie("botoValencia", "botoValencia"+i, this.getNextHighestDepth());
    this["botoBarça"+i]._x = 100+i*56;
    this["botoBarça"+i]._y = 28;
    this["botoValencia"+i]._x = 450+i*56;
    this["botoValencia"+i]._y = 28;
    _root["botoBarça"+i].onPress = function() {
    dragging = true;
    startDrag(this);
    };

    _root["botoBarça"+i].onRelease = _root["botoBarça"+i].onReleaseOutside=function () {
    dragging = false;
    stopDrag();
    if (eval(this._droptarget) == areaPetitaN || camp) {
    positionPlayersBarça++;
    if (positionPlayersBarça>=7) {
    localReady_btn._visible = true;
    }
    }
    };

    this is the code on clicking the ready button:

    this.visitorReady_btn.onPress = function(){
    visitorReady = true;
    if(localReady == true && visitorReady == true){
    dragging = false;
    delete placePlayers(); // this is what I thought worked.
    gotoAndStop("game");
    }
    }

    this.localReady_btn.onPress = function(){
    localReady = true;
    if(localReady == true && visitorReady == true){
    dragging = false;
    delete placePlayers(); // this is what I thought worked. gotoAndStop("game");
    }
    }

    I include the swf for better explanation... drag all the players to their respective side of the field before jumping to the game frame.
    Last edited by capdetrons; 02-21-2012 at 01:46 PM. Reason: poor post

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