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
Linking 1 sprite to another by location
Universal serial port behavior
Flash Component Label
DM ChangeRes
Bit Checker
Check user's administrative privileges on NT platform
Drag Sprite with Hotspot
Change Bitdepth
StartFramesScript
To activate previous instance and quit
 

 

 

Behavior Stock quote

Added on 5/26/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: bugmeister

Attached to a field, this behavior retrieves data from Yahoo"s finacial site to show you the current quote.

--#####################################
--##        Stock Quote behavior     ##
--##      Written by Aviyam Fischer  ##
--##         aviyam@bigfoot.com      ##
--#####################################
--
-- Usage: Create a text field and attach
--        this behavior to it.
--
property spriteNum
property theNetID
property theStock
property refreshTime


on beginSprite me
  theURL="http://finance.yahoo.com/d/quotes.csv?s="&theStock&"&f=sl1d1t1c1ohgv&e=.csv"
  set theNetID = getNetText(theURL)
  startTimer
end

on exitFrame me
  if netDone(theNetID) then
    theQuote =  netTextResult(theNetID)
    member(sprite(me.spriteNum).member).text = theQuote.item[2]
  else
    doConnectionAnimation(me)
  end if
  if the timer>= refreshTime *60 then beginSprite(me)
end

on doConnectionAnimation me
  if member(sprite(me.spriteNum).member).text = " * * " then
    member(sprite(me.spriteNum).member).text = "* * *"
  else
    member(sprite(me.spriteNum).member).text = " * * "
  end if
end

on getPropertyDescriptionList
  vPDlist = [:]
  setaProp vPDList, #theStock, [#comment: "The stock to quote:", #format: #string, ¬
    #default: "AAPL"]
  setaProp vPDList, #refreshTime, [#comment: "refresh time (ticks)", #format: #integer,¬
  #range: [#min: 100, #max: 1000],#default: 600]
  return vPDList
end

 


Contact

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

Send e-mail