You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2017/05/31 23:36:07 UTC
[3/6] git commit: [flex-asjs] [refs/heads/release0.8.0] - photo
library works on my LG
photo library works on my LG
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c5216086
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c5216086
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c5216086
Branch: refs/heads/release0.8.0
Commit: c5216086f2e0d2d7def40483aca29813c20a7ba5
Parents: 5c93d4d
Author: Alex Harui <ah...@apache.org>
Authored: Wed May 31 15:42:06 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed May 31 15:42:06 2017 -0700
----------------------------------------------------------------------
.../src/main/flex/MyInitialView.mxml | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c5216086/examples/flexjs/CordovaCameraExample/src/main/flex/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/CordovaCameraExample/src/main/flex/MyInitialView.mxml b/examples/flexjs/CordovaCameraExample/src/main/flex/MyInitialView.mxml
index dcdd742..2e79292 100644
--- a/examples/flexjs/CordovaCameraExample/src/main/flex/MyInitialView.mxml
+++ b/examples/flexjs/CordovaCameraExample/src/main/flex/MyInitialView.mxml
@@ -31,7 +31,7 @@ limitations under the License.
{
status.text = "ready";
}
-
+
public function snapPicture() : void
{
if (cam == null) {
@@ -46,17 +46,29 @@ limitations under the License.
image.src = String(imageData);
}
+ private function libSuccess(imageData:Object):void
+ {
+ output.text = "Chose photo file: " + String(imageData);
+ image.src = String(imageData);
+ }
+
private function failure(message:Object):void
{
output.text = "Failed: "+String(message);
}
+ private function onFromPhotoLibrary() : void
+ {
+ cam.getPhotoFromLibrary(libSuccess,failure);
+ }
+
]]>
</fx:Script>
<js:Label id="status" x="20" y="140" width="400" text="loading..."/>
+ <js:TextButton text="From Photo Library" x="20" y="20" click="onFromPhotoLibrary()" />
<js:TextButton text="Snap Picture" x="20" y="55" click="snapPicture()" />
<js:Label id="output" x="20" y="110" width="400"/>