Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

as3webstorage

as3webstorage is ActionScript wrapper utility that can easily use HTML5 Web Storage with Flash/Flex.

Supports the following API.

  • LocalStorage
  • SessionStorage

Web Storage

http://dev.w3.org/html5/webstorage/

Samples

How to use

HTML

<head>
...
  <script type="text/javascript" src="as3webstorage-0.1.2.js"></script>
...
</head>

Flash/Flex

import com.google.code.as3webstorage.LocalStorage;

protected function lengthButton_clickHandler(event:MouseEvent):void
{
    length_lengthText.text = String(LocalStorage.length());
}

protected function keyButton_clickHandler(event:MouseEvent):void
{
    var index:uint = uint(key_indexText.text);
    key_keyText.text = LocalStorage.key(index);
}

protected function getItemButton_clickHandler(event:MouseEvent):void
{
    var key:String = getItem_keyText.text;
    getItem_dataText.text = LocalStorage.getItem(key);
}

protected function setItemButton_clickHandler(event:MouseEvent):void
{
    var key:String = setItem_keyText.text;
    var data:String = setItem_dataText.text;
    LocalStorage.setItem(key, data);
}

protected function removeItemButton_clickHandler(event:MouseEvent):void
{
    var key:String = removeItem_keyText.text;
    LocalStorage.removeItem(key);
}

protected function clearButton_clickHandler(event:MouseEvent):void
{
    LocalStorage.clear();
}

private function setup():void
{
    LocalStorage.addStorageEventListener(reloadData, false);
}

private function reloadData(event:*=null):void
{
    Alert.show(event.newValue, "Confirm");
}

About

as3webstorage is ActionScript wrapper utility that can easily use HTML5 Web Storage with Flash/Flex.

Topics

Resources

License

Releases

No releases published
You can’t perform that action at this time.