This is a simple flash animation that loads variables from accelerometer if it is opened on the phone.
Script:
onEnterFrame = function() {
displayDevice = substring(eval("/:$version"), 0, 2) == "FL" ? "phone" : "pc";
if (displayDevice == "phone") {
loadVariables("accelerometer://data", _root);
} else {
accX = _root._xmouse;
accY = _root._ymouse;
accZ = 0;
}
}
displayDevice = substring(eval("/:$version"), 0, 2) == "FL" ? "phone" : "pc";
if (displayDevice == "phone") {
loadVariables("accelerometer://data", _root);
} else {
accX = _root._xmouse;
accY = _root._ymouse;
accZ = 0;
}
}
This code is the base of all my accelerometer-related animations.
If you use this code please inform me about it so I can check it out. Also, please link to Trekker Reactor on your site if you use this. There are already 2 web sites that I know of that they use the code they found here without linking to TR. I could ask a takedown from their host because of copyright infringement :P but I like to see more animations for SE. Hehehe.
Downloads:
Source file - for editing (.fla) - You need Adobe Flash CS3 to edit this
Exported file - for using on the phone (.swf)