AGo’s Tools

"AGo's Tools" is a small plugin that adds a few features that I think SWF Studio lacks.

Currently there are not very many functions in it, but if you could think of something handy to add feel free to contact me and I'll see if I can implement it.

Download

You'll want to get

Simply put the DLL file into your SWF Studio\plugins folder, it should then appear on the Plugin Tab where you can select it.

Command Reference

There is no real documentation yet (and probably won´t be) so here are all commands currently available.

sleep

I really missed that in AS, altough you probably never need it ;) This command will let your script wait for a specific amount of time, without consuming CPU cycles. You only pass it the ms time you want it to sleep

Actionscript:
  1. sleep_btn.onRelease = function() {
  2. ssCore.AGosTools.sleep({ms:3000});
  3. _root.out_txt.text += "\n... and I´m back!";
  4. };

findWindow

An addition to SWF Studio's Window command. Pass it the title of a window and you'll get the window handle back to access that window. Note that you need to know the full title, not only a part of it.

Actionscript:
  1. findWindow_btn.onRelease = function() {
  2.     var result_obj = ssCore.AGosTools.findWindow({title:" SWF Studio Professional Edition 3.3 - untitled "});
  3.     if (result_obj.success) {
  4.         var hwnd = parseInt(result_obj.result);
  5.         if (hwnd>0) {
  6.             //We found a window
  7.             _root.out_txt.text = "Found window at "+hwnd;
  8.         } else {
  9.             //No window found
  10.             _root.out_txt.text = "I´m sorry, no match,...";
  11.         }
  12.     }
  13. };

moveWindow

resizeWindow

These functions are the same as Studio`s, but they allow you to move other windows by passing their window handle. You need to find these out with findWindow first.

Actionscript:
  1. move_btn.onRelease = function() {
  2.     var out_obj = ssCore.AGosTools.moveWindow({hwnd:_root.moveHWND_txt.text, x:40, y:40});
  3.     if (!out_obj.success) {
  4.         _root.out_txt.text = "Move failed:\nSWF Studio error\n"+out_obj.Error.description+" (Code "+out_obj.Error.code+")";
  5.     }
  6. };
  7. //
  8. resize_btn.onRelease = function() {
  9.     var out_obj = ssCore.AGosTools.resizeWindow({hwnd:_root.resizeHWND_txt.text, width:230, height:430});
  10.     if (!out_obj.success) {
  11.         _root.out_txt.text = "Resize failed:\nSWF Studio error\n"+out_obj.Error.description+" (Code "+out_obj.Error.code+")";
  12.     }
  13. };

Known Limitations

moveWindow and resizeWindow freeze if you pass them the hwnd of your own Application, so simply use SWF Studio´s ssCore.Window commands for that purpose.

Please leave your comments at the blog post.