dcsimg
A Flash Developer Resource Site

Results 1 to 20 of 22

Thread: Pop up number? Flash RPG

Threaded View

  1. #1
    Senior Member
    Join Date
    Mar 2005
    Location
    U.S.A . VA.
    Posts
    108

    Pop up number? Flash RPG

    I am able to display a certain amount of damage that was done during an attack. But what if I wanted the numbers in a better font? Or some sort of animation? Could this be done with a movie clip? surely I wouldn't have to make 1 movie clip for every possible numerical outcome of the damage right?

    Here is the current code I use to display damage ((For some reason I named the variable "monies" as this experiment/educational flash file started out as a bar tender clicky thing))



    code:
    _root.popupNumber=function(x:Number,y:Number,value  :Number){
    var mc=_root.createEmptyMovieClip("temp",_root.getNext HighestDepth());
    mc._x=x;
    mc._y=y;
    mc.spd=1;
    fmt=new TextFormat();
    fmt.font = "monies";
    fmt.color = 0x3399FF;
    fmt.size = 96
    mc.createTextField("txt", mc.getNextHighestDepth(), 0, 0, 100, 100);
    mc.txt.autoSize="center";
    mc.txt.embedFonts=true;
    mc.txt.selectable=false;
    mc.txt.text=value;
    mc.txt.setTextFormat(fmt);
    mc.onEnterFrame=function(){
    this.txt._x=-this.txt._width/2;
    this.txt._y=-this.txt._height/2
    this._alpha-=this.spd;
    this.spd+=1;
    if(this._alpha<=0)this.removeMovieClip("temp");



    Thanks anyone who read this far! :P
    Last edited by Ecuder; 10-29-2012 at 04:56 AM.
    How can you say so much, but say so little?

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