Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ActiveX with JS (Read 7440 times)
rad1
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 24th, 2009
ActiveX with JS
Dec 3rd, 2009 at 2:00pm
Print Post  
hello,

Can I use all function of the ActiveX with JavaScript or VBS ?

Have you some samples ?

Can I set a picture background for each box using FlowChartX ?

Thank for help.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ActiveX with JS
Reply #1 - Dec 3rd, 2009 at 2:44pm
Print Post  
Hi,

You should be able to use most of them, except ones that take byte array arguments. You can see some scripts used on this page of the online demo, use the browser's "view source command":

http://mindfusion.eu/demos/flowchartx/demo_std_page2.htm

You could set box.Picture = fcx.ScriptHelper.LoadImageFromUrl(some_url)

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
rad1
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 24th, 2009
Re: ActiveX with JS
Reply #2 - Dec 4th, 2009 at 11:59am
Print Post  
Thanks for reply.

I want to use a local picture. I used box.LoadPicture("logo.gif") with VBScript and it works well. But when I switch to JS, it don't work. with no error !!!

I use the following code :

Code
Select All
<script TYPE="text/javascript" FOR="fcx" EVENT="BoxCreated(box)">
box.LoadPicture("logo.gif")
</script> 



Thank you for help.
  
Back to top
 
IP Logged
 
rad1
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 24th, 2009
Re: ActiveX with JS
Reply #3 - Dec 4th, 2009 at 12:23pm
Print Post  
I think it's because I use relative and not absolute path. The problem is how can I get the absolute path. It is completely different in our application when we change the machine.

have you any Idea please ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ActiveX with JS
Reply #4 - Dec 4th, 2009 at 1:32pm
Print Post  
I think the EVENT FOR attributes of the script element are VBScript extensions, so the event handler is not called when you switch to JavaScript. You might add an alert to see if that's the case. You can see some ways to attach event handlers here -
http://msdn.microsoft.com/en-us/library/ms974564.aspx
  
Back to top
 
IP Logged
 
rad1
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 24th, 2009
Re: ActiveX with JS
Reply #5 - Dec 4th, 2009 at 4:09pm
Print Post  
No, it's not a problem of event. I use the following code to test :

Code
Select All
<script TYPE="text/javascript" FOR="fcx" EVENT="BoxCreated(box)">
box.LoadPicture("logo.gif") // don't work
box.resize(103,103)  // Work
alert("ok")  // work too
alert(box.Picture) // I obtain "null"
</script> 



Thank you for help.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ActiveX with JS
Reply #6 - Dec 5th, 2009 at 8:38am
Print Post  
How the path changes if you run the application on a different machine, aren't you loading it from a web server?

If you are running it as a local application, e.g. the IE ActiveX control hosted in your VB form, and don't specify the full image file path, then LoadPicture will work only if the image is in the current directory for the application's process

If you load the page from a web server, use the ScriptHelper.LoadImageFromURL method as shown above.

Stoyan
  
Back to top
 
IP Logged
 
rad1
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 24th, 2009
Re: ActiveX with JS
Reply #7 - Dec 5th, 2009 at 10:43am
Print Post  
Okey, each client have his server adress. We look for an application that can run on any server, whatever its IP adress.

Undecided The solution is to configure our application for each server adress.

Thank you for help.   Wink
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ActiveX with JS
Reply #8 - Dec 6th, 2009 at 9:18am
Print Post  
You could use the window.location properties to get the server address and create the image url from it.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
rad1
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 24th, 2009
Re: ActiveX with JS
Reply #9 - Dec 25th, 2009 at 1:13pm
Print Post  
Yes, I found the solution. It's based on the same idea. Grin
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint