PRB: Unable to Access Script in ALX from Script in HTMLID: Q163397
|
When attempting to invoke a script embedded in an .alx file from a script in an HTML page, which references that ALX via an HTML Layout control, the following error occurs:
VBScript runtime error. Line <n>: Type Mismatch
The following two steps are required to work around this problem:
VBScript runtime error. Line <n>: Type Mismatch
This behavior is by design.
<HTML>
<HEAD>
<TITLE>New Page</TITLE>
<SCRIPT LANGUAGE=VBSCRIPT>
Sub cmdHtm_Click
' Demonstrates the inability of the container to call
' contained code
' Clicking on cmdHTM will generate a scripting error
ALXFunc
End Sub
Sub HTMFunc()
' Demonstrates the ability to call code from the container
MsgBox "Code in the HTML file was invoked!"
End Sub
Sub cmdChangeALXButtonProps_Click()
' Demonstrates the it's possible for code in an HTML file to
' modify the properties of object contained in an embedded ALX.
layout1_alx.cmdAlx.caption = "Click me!"
layout1_alx.cmdAlx.backColor = &h80000010
End Sub
</SCRIPT>
</HEAD>
<BODY>
<OBJECT ID="cmdHtm" WIDTH=99 HEIGHT=88
CLASSID="CLSID:D7053240-CE69-11CD-A777-00DD01143C57">
<PARAM NAME="Caption" VALUE="Button in HTML">
<PARAM NAME="Size" VALUE="2611;2328">
<PARAM NAME="ParagraphAlign" VALUE="3">
</OBJECT>
<P>
<OBJECT ID="cmdChangeALXButtonProps"
CLASSID="CLSID:D7053240-CE69-11CD-A777-00DD01143C57"
STYLE=
"TOP:150pt;LEFT:100pt;WIDTH:74pt;HEIGHT:66pt;TABINDEX:0;ZINDEX:0;">
<PARAM NAME="Caption" VALUE="Change Caption">
<PARAM NAME="Size" VALUE="2611;2338">
<PARAM NAME="ParagraphAlign" VALUE="3">
</OBJECT>
<P>
<OBJECT ID="layout1_alx"
CLASSID="CLSID:812AE312-8B8E-11CF-93C8-00AA00C08FDF"
STYLE="LEFT:0;TOP:0">
<PARAM NAME="ALXPATH" REF VALUE="oneway.alx"
</OBJECT>
</BODY>
</HTML>
<SCRIPT LANGUAGE="VBS">
Sub cmdAlx_Click
' Demonstrates invoking code located in containing HTML
HTMFunc
End Sub
Sub ALXFunc()
' Demonstrates the inability of the container to call
' contained code
MsgBox "Code in ALX was invoked!"
End Sub
</SCRIPT>
<DIV ID="layout1" STYLE="LAYOUT:FIXED;WIDTH:78pt;HEIGHT:69pt;">
<OBJECT ID="cmdAlx"
CLASSID="CLSID:D7053240-CE69-11CD-A777-00DD01143C57"
STYLE=
"TOP:0pt;LEFT:0pt;WIDTH:74pt;HEIGHT:66pt;TABINDEX:0;ZINDEX:0;">
<PARAM NAME="Caption" VALUE="ALX Button">
<PARAM NAME="Size" VALUE="2611;2328">
<PARAM NAME="ParagraphAlign" VALUE="3">
</OBJECT>
</DIV>
Additional query words:
Keywords : kbIE500 AXSDKScripting
Version : 2.00
Platform : WINDOWS
Issue type :
Last Reviewed: July 2, 1999