|
|||
|
Hi everyone,
Just downloaded a demo copy of SWFKit to replace the Zinc application I've been using. Basically right now the Zinc browser is buggy and won't let me create the functionality for the project I need to complete asap. Here's what I'm trying to achieve, it's quite simple. We have an .aspx website that will run on a local network server. I've created simple interface that has a few buttons and the window control buttons. I'm using AS3 in my .swf. I need to be able to set the URL that the IE control first loads in dynamically via a .txt file or .xml. One of my buttons will change this URL, also grabbing the actualy link from a .txt or .xml file. So far I've got the application minimizing, maximizing and restoring it's original size and I'm about to look at the screen capture feature. I'm really strugling with this initial URL loading from .xml or a .txt file. I've tried loading variables in, which I can't get to work Can anyone help me please! It would be great if you could spare the time to post some code up or links to help me figure this out. My project files can be downloaded here: http://www.urbanriver.com/project-files.zip Many thanks ![]() Last edited by urbanriver; 03-30-2009 at 09:03 AM. |
|
|||
|
Don't know if this is what you want but...
I would add this call to the swffunction in your actionscript Code:
function ParseBooks(urlInput:XML):void {
var iURL:String = urlInput;
trace(iURL);
// call swfkit function to load the iURL in the browser
flash.external.ExternalInterface.call("ShowPage",iURL)
}
Code:
function ShowPage(url){
// this function is called from your actionscript and uses the iURL as url
ax.activex.navigate2(url);
}
|
|
|||
|
Thanks Meester!
I've tried what you suggested but maybe I'm not putting things in correctly: In the SWFKit initialize script everything I have is: Code:
// Create the web browser control
var ax = createControl("Shell.Explorer.2", 0, 0, 1025, 670);
function ShowPage(url){
// this function is called from your actionscript and uses the iURL as url
ax.activex.navigate2(url);
}
// Fill the web browser control in the entire client area of the main window
getMainWnd().onSize = function(type, width, height)
{
ax.window.move(-5, 45, width+5, height+5);
}
Code:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("url.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseBooks(xmlData);
}
function ParseBooks(urlInput:XML):void {
var iURL:String = urlInput;
trace(iURL);
// call swfkit function to load the iURL in the browser
flash.external.ExternalInterface.call("ShowPage",iURL);
}
Hope you can help! Cheers |
|
|||
|
it seems to work for me
http://www.oefeningen.net/SelfContained2.zip I did change the url in the xml to Google since i couldn't use the original url But when i run the application, it shows the google page immediatly ![]() Last edited by meester; 03-30-2009 at 02:14 PM. |
|
|||
|
Hmm, I wonder if it's not working for me as I'm using the demo unregistered version?
At least I know its works for you so I'll just have to figure out why it won't work on my machine for me. Thanks so much for your help today. You're a life saver, or deadline saver so to speak ![]() |
|
|||
|
Kind of working now. If I preview (F9) its works fine but if I test (F5) or build it (F7) it doesn't. Any ideas?
![]() If I preview it using the file you sent me it works fine but if I preview it using my other file elsewhere on my computer it produces a Run Time error and crashes SWFKit. I think I'll try to reinstall SWFKit. Last edited by urbanriver; 03-30-2009 at 03:16 PM. |
|
|||
|
A reinstall solved the preview problem but I also had to overwrite my file with the one you send me back.
If I run the exe that it create outside of the preview mode it doesn't work so I suspect it's due to being unregistered. I've bought the software and I'm awaiting the key so hopefully it'll work soon. Thanks again! |
|
|||
|
Bah, I got my serial, activated the software and built the App. It still only works in preview mode and not when I run the EXE application.
Can anyone at SWFKit please help me understand what I'm doing wrong here? Many thanks |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|