Some MHEG+ code

Here's some MHEG+ code that will blow your mind.



{:Scene "/article.mhg"
:Items (
{:Link 1
:EventSource 0
:EventType IsRunning
:LinkEffect
(
//	 app#txtRed.run()
//	 app#txtYellow.run()
app#txtGreen.run()
app#txtGreen.SetData('Inbox')
app#txtBlue.run()
app#txtBlue.SetData('Notify Me')
// load a text file into a text object...
waitOnContent.activate()
app#castToContent.call ( app#rpBool
:IndirectRef app#articleURL
:IndirectRef app#webRef
)
app#rc_txtLoaderObject.SetData( :NewRefContent
(
:IndirectRef app#webRef
)
)
)
}
{:Link waitOnContent
:InitiallyActive false
:EventSource app#rc_txtLoaderObject
:EventType ContentAvailable
:LinkEffect (
:Deactivate (waitOnContent)
app#rc_lnkInitSearch.activate()
readData.activate()
)
}
{:Link readData
:InitiallyActive false
:EventSource readData
:EventType isRunning
:LinkEffect (
readData.deactivate()
app#rc_strTag.setVariable('h')
app#rc_lnkLookUpTag.activate()
txtHeader.setData(:IndirectRef app#rc_strValue)
app#rc_strTag.setVariable('content')
app#rc_lnkLookUpTag.activate()
txtContent.setData(:IndirectRef app#rc_strValue)
app#rc_strTag.setVariable('graphic')
app#rc_lnkLookUpTag.activate()
app#castToContent.call ( app#rpBool
:IndirectRef app#rc_strValue
:indirectRef articleGraphic
)
imgGraphic.setData(:NewRefContent (:IndirectRef articleGraphic))
//imgGraphic.scaleBitmap( 200 200 )
)
}
{:Text txtHeader
:CHook 10
:OrigContent "Header"
:OrigBoxSize	 500 50
:OrigPosition	58 68
}
{:Text txtContent
:CHook 10
:OrigContent "Lots and lots of content."
:OrigBoxSize	 500 390
:OrigPosition	58 130
:TextWrapping	true
}
{:ContentRefVar articleGraphic
:OrigValue	:ContentRef ''
}
{:Link lnkKeyBlue
:EventSource 0
:EventType UserInput
:EventData KeyBlue
:LinkEffect
(
:TransitionTo ("/b.mhg")
)
}
{:Link lnkKeyText
:EventSource 0
:EventType UserInput
:EventData KeyText
:LinkEffect
(
:Quit ()
)
}
{:Bitmap imgGraphic //must be PNG
:CHook pngCHook
:OrigContent :ContentRef ('')
:OrigBoxSize 200 200
:OrigPosition 50 260
}

)
:InputEventReg 4
:SceneCS 720 576
}