开发者

Intangible Flash textfields

开发者 https://www.devze.com 2023-03-16 04:20 出处:网络
I\'m currently trying to mimic a screen from a flash game for my own inscrutable purposes, and a typical screenshot of the screen in question looks something like this . I\'ve successfully found and e

I'm currently trying to mimic a screen from a flash game for my own inscrutable purposes, and a typical screenshot of the screen in question looks something like this

Intangible Flash textfields

. I've successfully found and extracted the background image

Intangible Flash textfields

from the file, and now I'm trying to find out the positio开发者_如何转开发ning of the various text fields. The actionscript for the SWF has the various textfields being declared as such:

public var speedText:TextField;
public var exp:TextField;
public var evadeText:TextField;
public var lvl:TextField;
public var critText:TextField;

The problem I have is that I can't find any instance anywhere in the code that actually assigns x, y, width, or height attributes to any of the text fields, nor are they anywhere on the stage using Flash CS4, so I can't determine their positioning at all. I've searched all actionscript files associated with the swf for any instance of the textfield names, without any hits except for assigning text to them. If they aren't receiving their positioning attributes via actionscript, how are they receiving these values, and how can I obtain them?


load the swf with a Loader-Instance, then you can loop through its children and trace the positions:

private function loadCompleteHandler(event : Event) : void
{
var content : MovieClip = loader.content as MovieClip;
loopIt(content);
}
private function loopIt(movieClip : MovieClip) : void
{
  for(var i : int = 0; i < movieClip.numChildren; i++)
  {
   trace("x pos: " + movieClip.getChildAt(0).x);
   if(movieClip.getChildAt(0) is MovieClip)
   {
     if(movieClip.getChildAt(0).numChildren>0)
     {
        loopIt(ovieClip.getChildAt(0));
     }
   }
  }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号