Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Regular expressions
StringLib
Play and cleanup DV Sprites
Math
Setup Anim
Digital Video
RC4 Encryption Algorithm Script
Get Member Modified Time and Date
vList Utility
Check For Previous Open
 

 

 

Behavior ActiveX Web controler

Added on 6/18/1999

 

Compatibilities:
behavior D7 D8 Mac PC

This item has not yet been rated

Author: MediaMacros (website)

Drop this one on your Web ActiveX control, the buttons and the entry field. The rest should be pretty easy. Be sure to put it in any frame after frame 1. If it is placed in frame 1 (especially in authoring) it may not respond and may return errors.

--Copyright 1999 Chuck Neal
--chuck@mediamacros.com
--If you find this code helpful, send me an e-mail and let me know.  :-)

property initialURl, spriteNum, command, whenGo, browserSprite

on getPropertydescriptionList me
  p_list = [:]
  if (sprite the currentSpriteNum).member.type = #activeX then
    addProp p_list, #initialURL, [#format : #string, #default : "www.mediamacros.com", #comment : "Default URL"]
  else if (sprite the currentSpriteNum).member.type = #field then
    addProp p_list, #whenGo, [#format : #symbol, #comment : "When to browse to new URL?", #default : #EnterKey, #range : [#EnterKey, #TabKey, #Both]]    
  else
    addProp p_list, #command, [#format : #symbol, #comment : "What Button is this?", #default : #Back, #range : [#Forward, #Back, #StopAction, #Search, #Home, #refresh]]
  end if
  return p_list
end

on beginSprite me
  if (sprite spriteNum).member.type = #activeX then
    navigate((sprite spriteNum), initialURl)
    sendAllSprites(#IAmBrowser, spriteNum)
  end if
end


on mouseUp me
  if (sprite spriteNum).member.type = #activeX then
    pass
  else if (sprite spriteNum).member.type = #field then
    --    (sprite spriteNum).hilite = true
  else
    case command of
      #Back : goBack(sprite browserSprite)
      #Forward : goForward(sprite browserSprite)
      #StopAction : stop(sprite browserSprite)        
      #Search : goSearch(sprite browserSprite)
      #Home : goHome(sprite browserSprite)
      #Refresh : refresh(sprite browserSprite)
    end case
  end if
end

on keyDown me
  if (sprite spriteNum).member.type = #field then
    if the key = RETURN then
      if whenGo = #EnterKey or whenGO = #both then
        navigate(sprite browserSprite, (sprite spriteNum).member.text)  
      end if
    else if the key = tab then
      if whenGo = #TabKey or whenGO = #both then
        navigate(sprite browserSprite, (sprite spriteNum).member.text)  
      end if
    else
      pass
    end if
  end if
end

on IAmBrowser me, whatSprite
  put whatSprite
  browserSprite = whatSprite
end

on getBehaviorDescription me
  describe = "Place this behavior on your Internet Explorer activeX sprite and on all your buttons and the URL field.  Make sure that all start on the same frame and that the Web ActiveX sprite is after (larger sprite number) than the buttons.  That"s all there is to it."
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail