AIR Encrypted SQLite Database

import flash.data.*; import flash.filesystem.File; private var dbConn:SQLConnection = new SQLConnection(); private var dbStatement:SQLStatement = new SQLStatement(); private function init(): void { // create a seed string of your choice var mySeed:String = “AIR15IsAGreatProduct”; // prepare a bytearray variable to hold the encryption key var myKey:ByteArray = new ByteArray(); // create the myKey ByteArray var [...]

SQLite example for AIR

Here is a very simplistic Flex Builder 3 and AIR example that adds and removes records from a table in a local SQLite database. This is not a fully completed AIR project but this code can probably be reused by anyone wanting to get started with AIR+SQLite. There are a couple of other AIR+SQLite [...]

Flex EncryptedLocalStore and SharedObject

วันนี้นั่งงงกับการลบ ShareObject ของ Flash ว่าทำไม ลบแล้วยังดึงค่า username และ password จาก EncryptedLocalStore มาได้อีก ที่แห้ก็พึ่งรู้ว่ามันดันแยก AIR ออกไปไกลเลย โดยสำหรับ Windows XP จะอยู่ที่ Path นี้ครับ

SharedObject

C:\Documents and Settings\User\Application Data\Macromedia\Flash Player\#SharedObjects

EncryptedLocalStore

C:\Documents and Settings\User\Application Data\Adobe\AIR\ELS

- -*

Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press.

พอดีว่าวันนี้ ตั่งใจเปลี่ยน file download ใน flex จากเดิม ใช้ navigateToUrl(urlRequest) ให้เป็น fileReference.download(urlRequest) ปรากฏว่าเจอ error 55+

Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press.

เนื่องจากว่า Flash player 10 มันมี security check ไว้ ถ้าจะใช้ไฟล์ดาวโหลด ต้องเป็น event ที่มาจาก User interface [...]

DragOver Event in Flex and Air

ก็เนื่องจากงานที่ต้องทำ มันมีการเขียน Code หาตำแหน่ง MouseY ในส่วนของฟังก์ชั้น DragOverHandler ซึ่งมันก็ทำงานปกติใน Web Application (ใช้ Flash player) แต่เมื่อเอามารันบน Air ปรากฏว่า มันดันหาค่าพิกัด Y ออกมาเป็นค่าคงที่ตลอด ก็เลยงง ทำไมรันบน flash มันเวิร์ก แต่พอมารันบน air กลับไม่เวิร์ก

addEventListener(DragEvent.DRAG_OVER, dragOverHandler);

private function dragOverHandler(event:DragEvent):void{
trace(“MouseY: ” + mouseY);
}

Continue reading “DragOver Event in Flex and Air” »