I'm trying to make a standalone loader for a (online) flash game.
It's a little simple to make it working.
I need to pass a "fake" (the original game url) to the flash, and not the current url.
But i have some problems:
When it's loading, the flash app calls:
ExternalInterface.call('window . location.href.toString');
//using spaces because the forum use a [removed] replace for it.
To get the url, and if the url have "?salon=roomname"
(i think it's only this part of url that the flash handles)
It will get the room name, and automatically connects to it, if the flash don't find "salon" in the url, it will connect you to a random room.
It's here my problem:
- I'm using <embed> to load the flash in QWebView, and using setHtml() set the window . location.href to "about:blank".
- I've tried to "overload" the window . location object, i think, if i set a "fake" window . location, i can send the fake url to the flash. But, there's another problem:
But, what made me to try too much times is:
- With a last try, i've overloaded the String.prototype.toString() with this:
if (this == window . location.href) return window.FakeLoc.href;
else return this;
I know it isn't a good solution but, if worked at least i don't need to make "loading tricks", but this isn't working too.
And I'm really sure the game use that ExternalInterface.call('window . location.href.toString');
Because in C# when I use the FlashCall event I can get it and return the url.
Someone can help me with this ? What I can try now ? Is something that I've tried is wrong ?
There's a way to get a pointer to js window object or window . location object inside Qt ?
Is there a way wait external flash calls and respond to it by events ?
Thanks for reading, and for helping if you help ^^
Have a nice day,
and thanks again.
Sorry for the big question and sorry for the bad english.
@shadownt I understand that the answer is a bit late, but maybe it will help someone. You can use the second parameter in QWebView::setHtml
m_webView->setHtml( "html content here", QUrl("http://google.com"))
now the window.location will have the following value: