Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
PDF Xtra
Set Screen Size
Library for the control of volume in Director
ResourceXObject
Sprite Expander
Navegacion y colision 3d - 3d Collision Navigation
Campaign FOR current and future Macromedia Director users
MediaMacros Devcon Presentation 2002 - Imaging Lingo
DaoX
Sub Hunt
MediaMacros Xtras Mall
 

 

 

Behavior Label Search code

Added on 12/10/1999

 

Compatibilities:
behavior D6_5 D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: DebbieWhite

It creates a search engine that searches your labels for a word, then lists it. The user then types in the label they want to go to, then hit a "go to" button to be taken there.

--It creates a search engine that searches your labels for a word, then lists it.  The user then types in the label they want to go to, then hit a "go to" button to be taken there.  You need two fields and two buttons.  "Search Field" is a fixed, editable field where the user types in the search word or phrase.   "Output" is a fixed, non-editable field where the results of the search are placed.  The Search button should call the searchText on mouseUp. The Go To button should call jumpLoc on mouseUp.  The "on keyDown me" bit of code should be put in the "Search Field" sprite lingo.
--Copyright © 1999 Deborah White

on searchText
  set searchWord = the text of field "Search Field"
  set returnList = [:]
  set the text of field "Output" to ""
  set numList =  (the number of lines of the labelList) - 1
  if searchWord = "" then
    alert "Please enter a word"
  else
    repeat with i = 1 to numList
      set testWord to line i of the labelList
      set theOffset = offset(searchWord, testWord)
      if theOffset <> 0 then
        put testWord into returnList
        put returnList after member "Output"
        put RETURN after member "Output"
      end if
    end repeat
    if returnList = [:] then
      alert "This word was not found."
    end if
  end if
end

on jumpLoc
  set searchWord = the text of field "Search Field"
  set numList =  (the number of lines of the labelList) - 1
  repeat with i = 1 to numList
    set testWord to line i of the labelList
    if testWord = searchWord then
      set goWord = the text of field "Search Field"
      go to frame goWord
      set the text of field "Output" to ""
      set the text of field "Search Field" to ""
    end if
  end repeat
  if goWord <> SearchWord then
    alert "The page does not exist.  Check to make sure you entered the ¬
complete page title correctly"
  end if
end

on keyDown me
  if the key = return then
    searchText
  else
    pass
  end if
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail