我有一个健康栏,在进入框架时,它会略微减少并且未满。我怎样才能解决这个问题?“应该是”代表我希望它看起来像什么。“目前是什么”代表了我遇到的问题。
应该:
目前是:
package
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.events.KeyboardEvent;
import flash.utils.Timer;
import flash.text.Font;
import flash.events.MouseEvent;
import flash.text.TextDisplayMode;
import flash.text.TextExtent;
import flash.text.TextField;
import flash.text.TextFormat;
import fl.motion.easing.Back;
import flash.display.DisplayObject;
import flash.geom.Point;
import flash.ui.Mouse;
import flash.events.TimerEvent;
public class healthBar extends MovieClip
{
public var maxHP:int = 670;
public var currentHP:int = maxHP;
public var percentHP:Number = currentHP / maxHP;
public function healthBar()
{
updateHealthBar();
}
public function updateHealthBar()
{
percentHP = currentHP / maxHP;
scaleX = percentHP;
}
}
}