Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-30-2009, 10:00 AM
Junior Member
 
Join Date: Mar 2009
Posts: 19
Default Buttons, Variables & XML

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 10:03 AM.
Reply With Quote
  #2 (permalink)  
Old 03-30-2009, 12:09 PM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default

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)
}
In swfkit i ld write this function in the initialise script

Code:
function ShowPage(url){
    // this function is called from your actionscript and uses the iURL as url
    ax.activex.navigate2(url);
}
Reply With Quote
  #3 (permalink)  
Old 03-30-2009, 01:19 PM
Junior Member
 
Join Date: Mar 2009
Posts: 19
Default

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);
}
In my Flash Movie I have (exactly what you gave me):

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);
}
Basically the browser loads in completely empty.

Hope you can help!

Cheers
Reply With Quote
  #4 (permalink)  
Old 03-30-2009, 01:26 PM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default

Did you add url.xml to your resources?
(in your sourcefiles above you didn't)

Reply With Quote
  #5 (permalink)  
Old 03-30-2009, 01:39 PM
Junior Member
 
Join Date: Mar 2009
Posts: 19
Default

Yeah, I removed the url.html file and added the url.xml file and have all the file checked as in your screenshot.
Reply With Quote
  #6 (permalink)  
Old 03-30-2009, 03:09 PM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default

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 03:14 PM.
Reply With Quote
  #7 (permalink)  
Old 03-30-2009, 03:24 PM
Junior Member
 
Join Date: Mar 2009
Posts: 19
Default

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
Reply With Quote
  #8 (permalink)  
Old 03-30-2009, 04:11 PM
Junior Member
 
Join Date: Mar 2009
Posts: 19
Default

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 04:16 PM.
Reply With Quote
  #9 (permalink)  
Old 03-30-2009, 05:18 PM
Junior Member
 
Join Date: Mar 2009
Posts: 19
Default

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!
Reply With Quote
  #10 (permalink)  
Old 03-30-2009, 05:37 PM
Junior Member
 
Join Date: Mar 2009
Posts: 19
Default

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
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:12 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.