com. kelvinluck. flashr. core.Note

Class to describe a note on a photo on Flickr.

Instances of this class are created to hold notes that are attached to Photos returned from flickr.com

Currently very bare bones - this class will be expanded

Licence

This code and documentation is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0.  http://creativecommons.org/licenses/by-nc-sa/2.0/

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version

0.5.0

Author

Kelvin Luck < kelvin at kelvinluck dot com >

Project Website

http://flashr.kelvinluck.com/

Subversion Id

$Id: Note.as 77 2006-09-04 15:07:10Z kluck $

Summary
com. kelvinluck. flashr. core.NoteClass to describe a note on a photo on Flickr.
idThis note’s if
authorThe person who wrote this note
textThe contents of this note
xThe x coordinate of this note
yThe y coordinate of this note
widthThe width of this note
heightThe height of this note
photoThe Photo that this Note is on.
_notesA private static Object containing Note objects.
Note
destroyDestroys and deletes this Note.
getNoteGet’s a Note object for the given id.

id

public var id: String

This note’s if

author

public var author: Person

The person who wrote this note

text

public var text: String

The contents of this note

x

public var x: Number

The x coordinate of this note

y

public var y: Number

The y coordinate of this note

width

public var width: Number

The width of this note

height

public var height: Number

The height of this note

photo

public var photo: Photo

The Photo that this Note is on.  Filled on a call to Flashr.photosNotesAdd or Flashr.photosGetInfo.

_notes

private static var _notes: Object

A private static Object containing Note objects.  Used by getNote to insure that only one Note is created for each note id from flickr.com

Note

private function Note(id: String)
Constructor functioncreates a new Note object.

Don’t call directly, use getNote to make sure that there is only one Note instance for each id as returned by flickr.com

destroy

private function destroy()

Destroys and deletes this Note.  Private and called internally on a sucessful response from Flashr.photosNotesDelete.

getNote

public static function getNote(id: String):Note

Get’s a Note object for the given id.

Consults _notes to make sure that only one Note instance is created for each note id from flickr.com

Parameters

idThe id of the Note you want to get
public var id: String
This note’s if
public var author: Person
The person who wrote this note
public var text: String
The contents of this note
public var x: Number
The x coordinate of this note
public var y: Number
The y coordinate of this note
public var width: Number
The width of this note
public var height: Number
The height of this note
public var photo: Photo
The Photo that this Note is on.
Class to describe a photo from Flickr.
private function Note(id: String)
private static var _notes: Object
A private static Object containing Note objects.
private function destroy()
Destroys and deletes this Note.
public static function getNote(id: String):Note
Get’s a Note object for the given id.
function photosNotesAdd(photoId: String,
noteX: Number,
noteY: Number,
noteW: Number,
noteH: Number,
noteText: String)
Add a Note to a Photo.
function photosGetInfo (photoId: String,
secret: String):FlashrRequest
Calls flickr.photos.getInfo to get information about a Photo.
function photosNotesDelete(noteId: String)
Delete a Note from a Photo.