 
 	_updateContent: =>
 
+		return unless @content
+
 		# Update the size of the content layer, and the dragging constraints based on the 
 		# content size and contentInset.
 

	@define "scroll",
		get: -> @scrollHorizontal is true or @scrollVertical is true
		set: (value) ->
			@content.animateStop() if value is false
			@scrollHorizontal = @scrollVertical = value

	@define "scrollX",
		get: -> -@content.x
		set: (value) -> @content.x = -@_pointInConstraints({x:value, y:0}).x

	@define "scrollY",
		get: -> -@content.y
		set: (value) -> @content.y = -@_pointInConstraints({x:0, y:value}).y

	@define "scrollPoint",
		get: -> 
			point =
				x: @scrollX
				y: @scrollY
		set: (point) ->
			@content.animateStop()
			@scrollX = point.x
			@scrollY = point.y

	@define "scrollFrame",
		get: ->
			rect = @scrollPoint
			rect.width = @width


Events.ScrollStart = "scrollstart"
Events.Scroll = "scroll"
Events.ScrollMove = Events.Scroll
Events.ScrollEnd = "scrollend"

EventMappers = {}
