 		}
 
 		/**
-		 * Get the byte array to be used with a Loader.loadBytes or similar.
-		 * @return Avatar bytes if any
+		 * The byte array to be used with a Loader.loadBytes or similar.
 		 */
 		public function get avatar():ByteArray
 		{
 			return _imageBytes;
 		}
-
+		public function set avatar( value:ByteArray ) : void
+		{
+			_imageBytes = value;
+		}
+		
+		/**
+		 * The image type of the avatar. Used for saving the image.
+		 * If this is blank, the avatar will not be saved.
+		 */
+		public function set avatarType( value:String ) : void
+		{
+			_avatarType = value;
+		}
+		
 		/**
 		 * Deserializes the incoming IQ to fill the values of this vcard.
 		 * @param iq

		 *
		 */
		private var _avatar:DisplayObject;

		/**
		 *

				homeVoiceNode.NUMBER = homeVoiceNumber;
				vcardExtNode.appendChild( homeVoiceNode );
			}
			
			if ( avatar != null && _avatarType != null)
			{
				var avatarNode:XML = <PHOTO/>
				var avatarBase64:String;

				try
				{
					avatarBase64 = Base64.encodeByteArray(avatar);
				}
				catch(err:Error)
				{
					throw new Error("VCard:saveVCard Error encoding bytes " + err.getStackTrace());
				}
				
				try
				{
					var binaryNode:XML = <BINVAL/>;
					binaryNode.appendChild(avatarBase64);
					avatarNode.appendChild(binaryNode);
				}
				catch(err:Error)
				{
					throw new Error("VCard:saveVCard Error converting bytes to string " + err.message);
				}

				var typeNode:XML = <TYPE/>;
				typeNode.appendChild(_avatarType);
				avatarNode.appendChild(typeNode);
					
				vcardExtNode.appendChild( avatarNode );
			}

			iq.addExtension( vcardExt );
			connection.send( iq );
