Note that there are some explanatory texts on larger screens.

plurals
  1. POMy dynamically created movie clips are not going away
    primarykey
    data
    text
    <p>I am working on a breakout type game with dynamically-created squares. When a brick gets hit, I fire off a removeMC function that is supposed to turn it white and make it shrink down in size. However, sometimes the squares just turn white instead of tweening down. I have included the script for the removeMV function as well as the function that creates the squares. Arg1 is the square to be removed. I apologize for the bad naming conventions, but the fire got corrupted and had to be recovered with a decompiler.</p> <p>This is the removeMC function</p> <pre><code> public function removeMC(arg1:flash.display.Sprite):* { this.score --; this.uiBar.txtScore.text=this.score; var loc1:*=new flash.geom.ColorTransform(); loc1.color = 0xffffFF; arg1.transform.colorTransform = loc1; TweenMax.to(arg1, 0.4, {colorTransform:{tint:0x0000ff, tintAmount:1}}); var loc2:*=this.ballMC.x - this.ballMC.x % 30; var loc3:*=this.ballMC.y - this.ballMC.y % 30; arg1.scaleY = arg1.scaleY * -1; // trace("Ball x:" + this.ballMC.x + " ballY:" + this.ballMC.y + " block x:" + loc2 + " block y:" + loc3); var loc4:*=new fl.transitions.Tween(arg1, "width", null, 30, 0, 0.5, true); var loc5:*=new fl.transitions.Tween(arg1, "height", null, 30, 0, 0.5, true); var loc6:*=new fl.transitions.Tween(arg1, "x", null, 0, loc2, 0.5, true); var loc7:*=new fl.transitions.Tween(arg1, "y", null, 0, loc3, 0.5, true); this.brickArray.splice(this.indexSearch(this.brickArray, arg1), 1); arg1.x+=3000;//failsafe to remove the squares. doesn't work arg1.y+=3000; return; } </code></pre> <p>This is the function that creates the squares. Arg 1 and arg2 are the width and height in squares</p> <pre><code> public function createImgNodeGrid(arg1:int=1, arg2:int=1, arg3:Number=0):void { var loc6:*=0; var loc7:*=null; var loc8:*=null; var loc9:*=null; var loc10:*=null; var loc1:*=this._img.width / arg1; var loc2:*=this._img.height / arg2; var loc3:*=arg1 * arg2; this._imgNodes = []; var loc4:*=0; var loc5:*=0; while (loc5 &lt; arg1) { loc6 = 0; while (loc6 &lt; arg2) { loc7 = new flash.geom.Rectangle(loc5 * loc1, loc6 * loc2, loc1, loc2); loc8 = new flash.display.BitmapData(loc1, loc2, true); loc8.copyPixels(this._img.bitmapData, loc7, this.zero); loc9 = new flash.display.Bitmap(loc8); loc9.x = loc5 * (loc1 + arg3); loc9.y = loc6 * (loc2 + arg3); var loc11:*; this._imgNodes[loc11 = loc4++] = loc9; loc10 = new flash.display.Sprite(); loc10.mouseChildren = false; this.brickArray.push(loc10); loc10.addChild(loc9); this._tiledImg.addChild(loc10); ++loc6; } ++loc5; } return; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload