Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-25-2008, 06:33 PM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default getProperty() not working

Im trying to make my work a bit easier in fututre by binding ie control with one of my MC's
but it isnt working



Heres my code... tell me what am i doing wrong
i desperatly need help!!!

Code:
import SWFKit.*;
import SWFKit.FlashPlayer.*;
import WebBrowser;
function forumSpy():Void {
	var Locate = LocateMC;
	var LocateX = getProperty(LocateMC, _x);
	var LocateY = getProperty(LocateMC, _y);
	var locateW = getProperty(LocateMC, _width);
	var locateH = getProperty(LocateMC, _height);
	 //Create the web browser control
  var ax = Global.createControl("Shell.Explorer.2", 0,0,0,0);
  // Fill the web browser control in the entire client area of the
  // main window
  var win = Global.getMainWnd();
  ax.window.move(LocateX, LocateY, locateW, locateH);
  function onSize(type, width, height)
  {
    ax.window.move(LocateX, LocateY, LocateW, LocateH);
  }
  win.setEventHandler("onSize", onSize);

  var wb = WebBrowser.fromID(ax.activex);
  // handle event of the ActiveX control
  function NavigateComplete2(control, url)
  {
    _root.strace(url);
  }
  wb.setEventHandler("NavigateComplete2", NavigateComplete2);

  // Browse web site
  wb.Navigate2("http://mysite.com");
}
forumSpy();


I also tryied hide and close function... but bothing. in 8 hours now, what i have been testing, is not working...

Code:
import SWFKit.*;
import SWFKit.FlashPlayer.*;
import WebBrowser;
function yess(){
// Create the web browser control
  var ax = Global.createControl("Shell.Explorer.2", 0, 0, 200, 200);
  // Fill the web browser control in the entire client area of the
  // main window
  var win = Global.getMainWnd();
  ax.win.move(1, 23, 500, 216);
  function onSize(type, width, height)
  {
    ax.win.move(1, 23, 500, 216);
  }
  win.setEventHandler("onSize", onSize);

  var wb = WebBrowser.fromID(ax.activex);
  // handle event of the ActiveX control
  function NavigateComplete2(control, url)
  {
    _root.strace(url);
  }
  wb.setEventHandler("NavigateComplete2", NavigateComplete2);

  // Browse web site
  wb.Navigate2("http://www.flashguru.se/forum/forumspy.php");
}

function hiDe() {
	ax.win.hide();
}
testt.addEventListener("click", hiDe);
yess();
Code:
What the heck is wrong ????? ??? ??? ??? ??? ??? ??? ??? ???
Reply With Quote
  #2 (permalink)  
Old 01-28-2008, 06:05 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: getProperty() not working

Can you please send us your source file? With only the code it is very hard to find out the reason of the problem. Thank you.
Reply With Quote
  #3 (permalink)  
Old 01-29-2008, 01:47 AM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: getProperty() not working

i do not have this conde anymore :S i had to change ans use permanent x / y and w/h positions.



but at the moment ive been struggling with another problem (started even new topic)

since Createcontrol uses IE, then all the links are opened in IE (that have "_blank"), what do i need to do in as2 to make the links open new firefox window ???

i have no access to the website that im publishing with createcontrol() so i need a solution in as2

Thanx for your efforts and time!
Reply With Quote
  #4 (permalink)  
Old 01-29-2008, 12:28 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: getProperty() not working

You may use the method mentioned in another topic: first find the path name of firefox exe, and then launch it to open your html files. However, there is a disadvantage: the end users may have not installed firefox.


And it is unnecessary to do everything in as. In fact, calling ffish script from actionscript may be more convenient, and usually, can get higher performance. Any synchronous call between as and fs costs much CPU time, as a call should first be converted to XML data that will be parsed on the other side. Moreover, the "initialize" script is very useful and you cannot find equivalent action script.
Reply With Quote
  #5 (permalink)  
Old 01-29-2008, 12:38 PM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: getProperty() not working

yes, i found the code you postet there getFirefixPath()

but i cant get it to work, i think i need swfkit to get a link adress and then use firefox to open that link.

ive tryied to use getVariable and so on, so i could get this link adress but i couldnt.

Reply With Quote
  #6 (permalink)  
Old 01-29-2008, 12:40 PM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: getProperty() not working

heres the code i try to get to work

Code:
import SWFKit.*;
import SWFKit.FlashPlayer.*;
import WebBrowser;


// Create the web browser control
  var ax = Global.createControl("Shell.Explorer.2", 0, 0, 200, 200);
  // Fill the web browser control in the entire client area of the
  // main window
  var win = Global.getMainWnd();
	function klick() {
		Global.trace("ax");
	}
	ax.setEventHandler("onClick", klick);
  ax.window.move(1, 23, 500, 216);
  function onSize(type, width, height)
  {
    ax.win.move(1, 23, 500, 216);
  }
  win.setEventHandler("onSize", onSize);


  var wb = WebBrowser.fromID(ax.activex);
  // handle event of the ActiveX control
  function NavigateComplete2(control, url)
  {
    _root.strace(url);
  }
  wb.setEventHandler("NavigateComplete2", NavigateComplete2);
	wb.addEventListener("click", hamtaSidan);

  // Browse web site
  wb.Navigate2("http://site.com");

function onClick() {
	Global.trace("HIDE");
	ax.window.hide();
	_root.holder.Meny._visible = true;
	hide_WB._visible = false;
	info_WB._visible = false;
	ut_WB._visible = false;
}
hide_WB._visible = true;
_root.holder.Meny._visible = false;
hide_WB.addEventListener("click", onClick);
//yess();


function getFireFoxExePath() {
  var keyName = "HKLM\\SOFTWARE\\Mozilla\\Mozilla Firefox";
  var key = new RegKey(keyName);
  if (key != null) {
   var ver = key.getValue("CurrentVersion").data;
   keyName = keyName + "\\" + ver + "\\Main";
   key = new RegKey(keyName);
   if (key != null) {
     var pathName = key.getValue("PathToExe").data;
     return pathName;
   }
  }
  
  // this is for older versions of Firefox (eg, 0.8).
  else {
   keyName = "SOFTWARE\mozilla.org\Mozilla Firefox";
   key = new RegKey(keyName);
   if (key != null) {
     var ver = key.getValue("CurrentVersion").data;
     keyName = keyName + "\\" + ver + "\\Main";
     key = new RegKey(keyName);
     if (key != null) {
      var pathName = key.getValue("PathToExe").data;
      return pathName;
     }
   }
  }
}

function hamtaSidan() {
  //Shell.run(getFireFoxExePath());
  Global.trace(getFireFoxExePath()+ getValue());
  
}
Reply With Quote
  #7 (permalink)  
Old 01-31-2008, 11:10 PM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: getProperty() not working

no help ? ???
Reply With Quote
  #8 (permalink)  
Old 02-01-2008, 07:33 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: getProperty() not working

Can you please send us your source file? We will help you to modify it directly. That would be clear and prompt, as you have many questions. Thank you.
Reply With Quote
  #9 (permalink)  
Old 02-01-2008, 09:11 AM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: getProperty() not working

what mail adress should i use ?
Reply With Quote
  #10 (permalink)  
Old 02-01-2008, 09:15 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: getProperty() not working

support@swfkit.com
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 04:55 AM.


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.