开发者

Flash AS3: is it possible to search and replace across all .as files in a project?

All,

I have a question that's so triv开发者_JAVA百科ial and obvious that I can't believe it hasn't been asked and answered hundreds of times.

Yet, I can't find an answer.

Is it possible to do a "search & replace" across all the .as class files in an application?

If so, how?

[UPDATE] Sorry - should have clarified... I'm using the Flash CS5 IDE.

Thanks in advance!


As mentioned Flash by default doesn't. I would highly highly recommend FlashDevelop - you can serch across multiple files, and use regular expressions, which is just magical.

For example if you wanted to find every as file that had a private variable that was of type number you could use Search and Replace in Files in FlashDevelop with

private var [A-Za-z0-9_:]+Number

And it would list every private number variable in your project. Handy.

http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page


Try this JSFL component:

http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1019363

JSFL components are useful to extend the Flash IDE for your purposes. Learn to write it and you can develop the tools to help yourself and others.

Otherwise, I'd say it depends on your IDE:

i.e. in Flash CS3-5 - not by default

in Flash Builder / Flexbuilder - Ctrl (Cmd) + Shift + F

Or your texteditor of choice :

Textwrangler - Ctrl (Cmd) + Shift + F


Not with FlashIDE. Flash Builder has this function, however, if you don't have your project done with it, you can always use Total Commander on Windows or Automator on Mac, both let you batch edit files.


One thing you might try - if you really need the functionality, you can download a trial version of Flash Builder and set it as your class editor within Flash CS5 (here and here for tutorials; you can also set the default editor in the Preferences Window). Using Flash Builder, you can easily refactor your code in many ways, including search and replace.

It looks like Adobe has released Flash Builder 4.5, but that doesn't seem to be available for download.

Good luck.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜