Does anyone know of a way to script flash objects using WatiN?
I need a way to send arbitrary keystrokes to a flash application. I'm able to login with code such as this:
ie.TextField(Find.ById("email")).TypeText(username);
ie.TextField(Find.ById("password")).TypeText(password);
I'm looking for something like:
ie.FlashObject(Find.ById("flash-object")).TypeText("123");
Or if focus is set to the browser, flash responds, so free text would work:
ie.FreeText.TypeText("123");
Currently I'm using a windows forms app with SendKeys() and it's not very robust.
Thanks.
There is Ruby library called FlashWatir. Not exactly what you were looking for, but close.
Related
I was wondering if there was some way to be able to load Flash objects from a custom Java web-browser. I want to be able to view YouTube videos for example.
I have read this: Embedding Flash Component into Java App, but I am not sure how I would use this seeing as I do not have the Flash locally as a .swf. I do not know where it loads the Flash file from. Also, I would prefer the solution to not require buying a product.
I know for sure that this is do-able using C# and the WebBrowser class because that uses the Flash plugin for IE, I was just wondering if there was a way to do this with Java.
I would like to know if it is possible to mute only a specific window. For example I have got Firefox open and two more windows. I want to mute everything related to Firefox but not the whole sound of my computer.
Is this possible? If so, how can it be done?
look, basically, there isn't any relation between the window handle and the sound which something in its code is playing.. the audio card can't tell who wants it to play.
theoretically, there is an option to do what you want on web browsers, but it's not easy, and not 100%. it goes like this:
most of the audio that is playing from browsers are from known objects like wmp/quick time/vlc/flash/etc..
when the user will choose to mute all audio from firefox, your application will search those known objects in the firefox tabs, and mute/unmute them using their api.
in order to do that, you will need to write an extension to firefox, so you could have an access to the tabs memory from your application.
btw, what os?
and check this out: http://www.indev.no/?p=projects#flashmute (flashmute) i believe it does what is said - only for flash.
On Vista/Windows 7:
I expect there to be some API which can change the volume on a per process basis which the audiomanager uses. Should be relatively straight forward to use.
On XP
I don't think there is any built in functionality for what you want to do. I recommend just not offering that feature on XP. But if you really want to, there are some hackish solutions:
Usermode API hooking. Intercept the calls to audioapis with your own functions. These change the volume or manipulate the audiosignal so you get what you want. You need to do this differently for any of the several available audio-apis. I guess DirectSound and DirectShow are particularly annoying. And this requires injection of a dll into any process you want to manipulate. And this dll better not require the .net runtime. Search for IAT(import address table) or EAT(export address table) hooking.
Kernel mode audio hooking. Write a driver which intercepts the audio in the kernel and changes it on a per process basis. No clue how to do that.
But as you can see both solutions aren't good.
The other day I found myself addicted to a Flash game and frustrated by the thing at the same time. In a moment of frustration with the game I thought I would make a 'bot' to beat it for me. Well, I really wouldn't, but it made me realize: I don't know how to interact with another application in a way to do this. Which brings me to the question, how would one take screenshots of another running application and interact with it with the keyboard and mouse. Ideally the solution would be in a managed language like c#.
When doing the background reading the net was drowning with articles on scraping HTML. There were not many articles on actually screen scraping an application.
I'm looking for a way to interface with another application rather than script/macro another application.
Could something like Xming be used to redirect the interface? http://www.straightrunning.com/XmingNotes/
Perhaps a Terminal Services client?
http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx
Check out Sikuli, it is basically what you are looking for. It is written in Java however.
http://groups.csail.mit.edu/uid/sikuli/
I ended up making the bot which did all this and documented it in a post
http://www.charlesrcook.com/archive/2010/09/05/creating-a-bejeweled-blitz-bot-in-c.aspx
I have used AutoHotKey for application automation.
I want to create C# plugin for some 3d + Music editing stuff. I want to be able to run my files inside browsers pages (so to see HTML some Flash content and some content which is rant by my plugin) using something like HTML tag or some JavaScript. (So my plugin will be small, powerfull and i want it to run at least on Windows and Mac firefox and safary and Chrome)(If it'll be runing on Linux itll be grate)))
I'ma beginner so any helpfull info will be appriciated
You could achieve it using Silverlight .. think abt it .. :)
What's the proper way to communicate with Flash from C# when it's hosted in the ActiveX control? I see a CallFunction method which look promising to communicate with Flash but I'm having a hard time finding documentation about what the parameter data should look like. Also, what would the reverse look like; i.e. how could the Flash content notify C# of some kind of event?
You'll want to use SetVariable and CallFunction to achieve this. Here is a good, short tutorial on Flash and C# interop.