Internet Explorer ActiveX Control
NOTE:
ActiveX Controls have been deprecated by Microsoft in the latest versions of the
Windows operating system in favor of the DotNet framework and its controls.
While MAXScript still supports ActiveX controls, these have to be installed and registered
on the system to be accessible to MAXScript.
As a replacement of ActiveX controls, MAXScript supports DotNet controls in 3ds Max 9 and higher.
The following example should still work though since Internet Explorer continues to
provide ActiveX controls for backwards compatibility.
The following example creates an Internet Explorer browser control in a rollout and
registers it as extended viewport.
Pick "Web Page" from the Extended Views menu to display the rollout in the webpage.
Also click various hypertext links to see the text change in the viewports
SAMPLE SCRIPT
|
rollout rWebpage "Web page"
(
local txtObj
local vpsz = getViewSize()
activeXControl ax "http://www.yahoo.com" height:(vpsz.y-50) width:(vpsz.x-50) align:#center
fn checkTextObject =
(
if $text01 == undefined then
(
txtObj = text text:"" name:"text01"
addModifier txtObj (extrude amount:10)
txtObj.wirecolor = red
)
else ( txtObj = $text01 )
)
on rWebpage open do ( checkTextObject() )
on ax TitleChange txt do
(
checkTextObject()
if not (matchPattern txt pattern:"http:") then
(
if txtObj.text != text then
(
print txt
txtObj.text = txt
max tool zoomextents all
)
).y
addRollout rWebPage fWebPage
registerViewWindow fWebPage
showProperties rWebpage.ax
)
)
fWebPage = newRolloutFloater "Web page" rWebpage.vpsz.x rWebpage.vpsz.y
addRollout rWebPage fWebPage
registerViewWindow fWebPage
showProperties rWebpage.ax
|
WARNING!
|
Due to a change in ActiveX controls handling by Microsoft, URLs are ALWAYS expected
to start with "http://". Thus, using just "www.yahoo.com" would work in 3ds Max 5 but not in 3ds Max 6 and higher!
|